diff --git a/.DS_Store b/.DS_Store
index 2a68903d..1a3881ff 100644
Binary files a/.DS_Store and b/.DS_Store differ
diff --git a/.github/instructions/creation doc ressources ember-ui.instructions.md b/.github/instructions/creation doc ressources ember-ui.instructions.md
new file mode 100644
index 00000000..bec01ab5
--- /dev/null
+++ b/.github/instructions/creation doc ressources ember-ui.instructions.md
@@ -0,0 +1,770 @@
+# 🧠 GUIDE DE CRÉATION D'UNE NOUVELLE RESSOURCE DE DOCUMENTATION EMBER-UI
+
+## Rôle de l'agent
+
+Vous êtes un agent IA responsable de la création d'une nouvelle ressource de documentation dans le projet doc-app pour les composants **ember-ui**.
+
+Vous devez strictement suivre les instructions écrites, sans interprétation, sans déduction implicite et sans extrapolation.
+
+Si une information manque, est ambiguë ou contradictoire, vous devez vous arrêter et demander des clarifications.
+
+## Principe fondamental
+
+Le prompt utilisateur suivra toujours ce format :
+
+**"créer la ressource RESOURCE_NAME dans la section ember-ui/prefabs"**
+
+Par exemple : "A partir de ce context #context créer la ressource dropdown dans la section ember-ui/prefabs a partir de #dropdown"
+
+Conséquences obligatoires :
+- Le nom de la ressource est fourni par le prompt (RESOURCE_NAME)
+- La section cible est toujours `ember-ui/prefabs`
+- Ce fichier fournit la structure attendue, les patterns de fichiers, les conventions de routage et les types de composants
+
+⚠️ **Les exemples fournis ci-dessous sont des MODÈLES DE STRUCTURE, pas des définitions fonctionnelles finales**
+
+---
+
+## 📁 Structure du projet doc-app pour ember-ui
+
+```
+doc-app/
+├── app/
+│ ├── router.ts # Fichier de routage principal
+│ ├── templates/
+│ │ └── dashboard.gts # Template principal avec sidebar
+│ ├── routes/
+│ │ └── dashboard/
+│ │ └── docs/
+│ │ └── ember-ui/
+│ │ └── prefabs/
+│ │ └── [resource].ts # Fichier de route
+│ ├── templates/
+│ │ └── dashboard/
+│ │ └── docs/
+│ │ └── ember-ui/
+│ │ └── prefabs/
+│ │ └── [resource].gts # Template de la page
+│ └── components/
+│ └── docs/
+│ └── ember-ui/
+│ └── prefabs/
+│ └── [resource].gts # Composant de démonstration
+│
+└── translations/
+ ├── en-us.yaml
+ ├── fr-fr.yaml
+ └── ember-ui/
+ └── prefabs/
+ └── [resource]/
+ ├── en-us.yaml
+ └── fr-fr.yaml
+```
+
+---
+
+## Différences clés avec ember-input-validation
+
+| Aspect | ember-input-validation | ember-ui |
+|--------|------------------------|----------|
+| **Package** | `@triptyk/ember-input-validation` | `@triptyk/ember-ui` |
+| **Composants** | 3 exemples (basic, disabled, error) | 1 exemple unique |
+| **Focus** | Validation de formulaires | Composants UI génériques |
+| **Propriétés typiques** | @changeset, @validationField | Varie selon le composant |
+| **Clé i18n** | `emberInputValidation` | `ember-ui` |
+| **Label sidebar** | "[Resource] validation prefab" | "[Resource] prefab" |
+
+---
+
+## Tâches à effectuer (ordre obligatoire)
+
+### 1️⃣ Création de la route
+
+**Fichier à créer :**
+```
+doc-app/app/routes/dashboard/docs/ember-ui/prefabs/[RESOURCE_NAME].ts
+```
+
+**Structure exacte :**
+```typescript
+import Route from '@ember/routing/route';
+
+export default class DocsEmberUiPrefabs[ResourceName]Route extends Route {
+ model() {
+ return {
+ properties: [
+ {
+ name: '@propertyName',
+ type: 'string | Function | boolean | number',
+ required: true,
+ description: 'ember-ui.prefabs.[resource-name].properties.propertyName.description',
+ },
+ // Ajouter toutes les propriétés du composant
+ ],
+ };
+ }
+}
+```
+
+**Règles de nommage :**
+- Classe : `DocsEmberUiPrefabs` + PascalCase(resource) + `Route`
+- Clés i18n : `ember-ui.prefabs.[resource-kebab-case].properties.[property-name].description`
+
+**Exemple concret pour confirm-modal :**
+```typescript
+import Route from '@ember/routing/route';
+
+export default class DocsEmberUiPrefabsConfirmModalRoute extends Route {
+ model() {
+ return {
+ properties: [
+ {
+ name: '@onClose',
+ type: 'Function',
+ required: true,
+ description: 'ember-ui.prefabs.confirm-modal.properties.onClose.description',
+ },
+ {
+ name: '@onConfirm',
+ type: 'Function',
+ required: true,
+ description: 'ember-ui.prefabs.confirm-modal.properties.onConfirm.description',
+ },
+ {
+ name: '@cancelText',
+ type: 'string',
+ required: true,
+ description: 'ember-ui.prefabs.confirm-modal.properties.cancelText.description',
+ },
+ // ... autres propriétés
+ ],
+ };
+ }
+}
+```
+
+---
+
+### 2️⃣ Modification du router.ts
+
+**Fichier à modifier :** `doc-app/app/router.ts`
+
+**Localisation exacte :** Dans la section `ember-ui` > `prefabs`
+
+**Exemple avant :**
+```typescript
+Router.map(function () {
+ this.route('dashboard', { path: '/' }, function () {
+ this.route('docs', function () {
+ this.route('ember-ui', function () {
+ this.route('prefabs', function () {
+ this.route('confirm-modal');
+ });
+ });
+ });
+ });
+});
+```
+
+**Exemple après (ajout de 'dropdown') :**
+```typescript
+Router.map(function () {
+ this.route('dashboard', { path: '/' }, function () {
+ this.route('docs', function () {
+ this.route('ember-ui', function () {
+ this.route('prefabs', function () {
+ this.route('confirm-modal');
+ this.route('dropdown'); // ← NOUVELLE ROUTE
+ });
+ });
+ });
+ });
+});
+```
+
+**Contraintes strictes :**
+- Respecter l'indentation existante (2 espaces par niveau)
+- Ne modifier aucune autre route
+- Ajouter la nouvelle route à la fin de la section `ember-ui` > `prefabs`
+
+---
+
+### 3️⃣ Ajout dans la Sidebar
+
+**Fichier à modifier :** `doc-app/app/templates/dashboard.gts`
+
+**Localisation :** Dans le groupe `Ember UI`
+
+**Structure de l'entrée :**
+```typescript
+{
+ type: 'link',
+ label: '[Resource Name] prefab',
+ route: 'dashboard.docs.ember-ui.prefabs.[resource-name]',
+ tooltip: '[Resource Name] prefab',
+}
+```
+
+**Exemple concret pour 'dropdown' :**
+```typescript
+menuItems: SidebarItem[] = [
+ // ... autres groupes
+ {
+ type: 'group',
+ label: 'Ember UI',
+ tooltip: 'Ember UI Prefab',
+ items: [
+ {
+ type: 'link',
+ label: 'Confirm modal prefab',
+ route: 'dashboard.docs.ember-ui.prefabs.confirm-modal',
+ tooltip: 'Confirm modal prefab',
+ },
+ {
+ type: 'link',
+ label: 'Dropdown prefab', // ← NOUVELLE ENTRÉE
+ route: 'dashboard.docs.ember-ui.prefabs.dropdown',
+ tooltip: 'Dropdown prefab',
+ },
+ ],
+ },
+];
+```
+
+**⚠️ Différence importante :** Le label est "[Resource Name] prefab" (sans "validation")
+
+---
+
+### 4️⃣ Création du composant de démonstration
+
+**Fichier à créer :**
+```
+doc-app/app/components/docs/ember-ui/prefabs/[resource-name].gts
+```
+
+**⚠️ UN SEUL composant (pas 3 comme ember-input-validation)**
+
+**Structure type :**
+```typescript
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { action } from '@ember/object';
+import Tpk[ResourceName]Prefab from '@triptyk/ember-ui/components/prefabs/tpk-[resource-name]-prefab';
+
+export default class [ResourceName]Example extends Component {
+ @tracked propriété1 = valeurInitiale;
+ @tracked propriété2 = valeurInitiale;
+
+ @action
+ actionMethod() {
+ // Logique de démonstration
+ }
+
+
+
+
+}
+```
+
+**Exemple concret pour confirm-modal :**
+```typescript
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import TpkConfirmModalPrefab from '@triptyk/ember-ui/components/prefabs/tpk-confirm-modal-prefab';
+import { action } from '@ember/object';
+import TpkButtonPrefabComponent from '@triptyk/ember-input/components/prefabs/tpk-prefab-button';
+
+export default class ConfirmModalExample extends Component {
+ @tracked isOpen = false;
+ confirmQuestion = 'Are you sure?';
+
+ @action
+ open() {
+ this.isOpen = true;
+ }
+
+ @action
+ onClose() {
+ this.isOpen = false;
+ }
+
+ @action
+ onConfirm() {
+ this.isOpen = false;
+ alert('Confirmed');
+ }
+
+
+
+
+
+}
+```
+
+**Conventions de nommage :**
+- Fichier : kebab-case (ex: `confirm-modal.gts`, `dropdown.gts`)
+- Classe : PascalCase + `Example` (ex: `ConfirmModalExample`, `DropdownExample`)
+
+---
+
+### 5️⃣ Création du template de route principal
+
+**Fichier à créer :**
+```
+doc-app/app/templates/dashboard/docs/ember-ui/prefabs/[resource-name].gts
+```
+
+**Structure exacte :**
+```typescript
+import Component from '@glimmer/component';
+import DocPage from 'doc-app/components/doc/page';
+import DocSection from 'doc-app/components/doc/section';
+import DocPropertyTable from 'doc-app/components/doc/property-table';
+import { t, type IntlService } from 'ember-intl';
+import { service } from '@ember/service';
+import CodeExampleComponent from 'doc-app/components/doc/code-example.gts';
+import CodeBlock from 'doc-app/components/doc/code-block.gts';
+import [ResourceName]Example from 'doc-app/components/docs/ember-ui/prefabs/[resource-name].gts';
+
+interface Property {
+ name: string;
+ type: string;
+ required: boolean;
+ description: string;
+}
+
+interface [ResourceName]PrefabDocsSignature {
+ Args: {
+ model: {
+ properties: Property[];
+ };
+ };
+}
+
+export default class [ResourceName]PrefabDocs extends Component<[ResourceName]PrefabDocsSignature> {
+ @service declare intl: IntlService;
+
+ [resourceName] = \`
+
+ \`;
+
+
+
+
+
+ <:demo>
+
+ <[ResourceName]Example />
+
+
+ <:template>
+
+
+
+
+
+
+
+
+
+}
+```
+
+**Exemple concret pour confirm-modal :**
+```typescript
+import Component from '@glimmer/component';
+import DocPage from 'doc-app/components/doc/page';
+import DocSection from 'doc-app/components/doc/section';
+import DocPropertyTable from 'doc-app/components/doc/property-table';
+import { t, type IntlService } from 'ember-intl';
+import { service } from '@ember/service';
+import CodeExampleComponent from 'doc-app/components/doc/code-example.gts';
+import CodeBlock from 'doc-app/components/doc/code-block.gts';
+import ConfirmModalExample from 'doc-app/components/docs/ember-ui/prefabs/confirm-modal.gts';
+
+interface Property {
+ name: string;
+ type: string;
+ required: boolean;
+ description: string;
+}
+
+interface ConfirmModalPrefabDocsSignature {
+ Args: {
+ model: {
+ properties: Property[];
+ };
+ };
+}
+
+export default class ConfirmModalPrefabDocs extends Component {
+ @service declare intl: IntlService;
+
+ confirmModal = \`
+
+ \`;
+
+
+
+
+
+ <:demo>
+
+
+
+
+ <:template>
+
+
+
+
+
+
+
+
+
+}
+```
+
+**Règles pour le template :**
+- Classe : PascalCase de la ressource + `PrefabDocs`
+- Signature : Interface nommée `[ResourceName]PrefabDocsSignature`
+- Importer UNIQUEMENT le composant créé (1 seul)
+- Variable de code : nom de la ressource en camelCase
+- Clés i18n : `ember-ui.prefabs.[resource-name].[sous-section]`
+
+---
+
+### 6️⃣ Ajout des traductions dans les fichiers principaux
+
+**Fichiers à modifier :**
+- `doc-app/translations/en-us.yaml`
+- `doc-app/translations/fr-fr.yaml`
+
+**Structure à ajouter dans en-us.yaml :**
+```yaml
+ember-ui:
+ prefabs:
+ [resource-name]:
+ title: '[Resource Name]'
+ description: 'Description courte et claire du composant'
+ examples:
+ title: 'Examples'
+ basic: 'Basic usage'
+```
+
+**Exemple concret pour confirm-modal :**
+```yaml
+ember-ui:
+ prefabs:
+ confirm-modal:
+ title: 'Confirm Modal'
+ description: 'A modal component for confirmation dialogs.'
+ examples:
+ title: 'Examples'
+ basic: 'Basic usage'
+```
+
+**Structure à ajouter dans fr-fr.yaml :**
+```yaml
+ember-ui:
+ prefabs:
+ [resource-name]:
+ title: '[Nom de la ressource]'
+ description: 'Description courte et claire du composant en français'
+ examples:
+ title: 'Exemples'
+ basic: 'Utilisation basique'
+```
+
+**Exemple concret pour confirm-modal :**
+```yaml
+ember-ui:
+ prefabs:
+ confirm-modal:
+ title: 'Modale de confirmation'
+ description: 'Un composant de modale pour les dialogues de confirmation.'
+ examples:
+ title: 'Exemples'
+ basic: 'Utilisation basique'
+```
+
+**Règles pour les traductions :**
+- Clé de section : `ember-ui` (kebab-case avec tiret)
+- Clé de ressource : kebab-case du nom de la ressource (ex: `confirm-modal`)
+- Structure obligatoire : `title`, `description`, `examples.title`, `examples.basic`
+- **NE PAS ajouter de section `properties` ici** - elles sont dans des fichiers séparés
+- Le `title` est juste le nom de la ressource en Title Case
+- La `description` explique brièvement l'utilité du composant
+- `examples.title` : "Examples" (EN) / "Exemples" (FR)
+- `examples.basic` : "Basic usage" (EN) / "Utilisation basique" (FR)
+
+**Placement dans le fichier :**
+- Si la section `ember-ui` n'existe pas, la créer après `emberInputValidation`
+- Ajouter `prefabs` si non existant
+- Ajouter la ressource en ordre alphabétique sous `prefabs`
+
+---
+
+### 7️⃣ Création des traductions de propriétés
+
+**Fichiers à créer :**
+```
+doc-app/translations/ember-ui/prefabs/[resource-name]/en-us.yaml
+doc-app/translations/ember-ui/prefabs/[resource-name]/fr-fr.yaml
+```
+
+**Structure en-us.yaml :**
+```yaml
+properties:
+ propertyName1:
+ description: 'Description of the property in English.'
+ propertyName2:
+ description: 'Description of the property in English.'
+ # Une entrée par propriété définie dans la route
+```
+
+**Structure fr-fr.yaml :**
+```yaml
+properties:
+ propertyName1:
+ description: 'Description de la propriété en français.'
+ propertyName2:
+ description: 'Description de la propriété en français.'
+ # Une entrée par propriété définie dans la route
+```
+
+**Exemple concret pour confirm-modal (en-us.yaml) :**
+```yaml
+properties:
+ onClose:
+ description: 'Function to close the modal.'
+ onConfirm:
+ description: 'Function called when the user confirms the action.'
+ cancelText:
+ description: 'Text to display on the cancel button.'
+ confirmText:
+ description: 'Text to display on the confirm button.'
+ confirmQuestion:
+ description: 'The confirmation question to display to the user.'
+ isOpen:
+ description: 'Boolean to control the modal visibility.'
+```
+
+**Exemple concret pour confirm-modal (fr-fr.yaml) :**
+```yaml
+properties:
+ onClose:
+ description: 'Fonction pour fermer la modale.'
+ onConfirm:
+ description: 'Fonction appelée lorsque l\'utilisateur confirme l\'action.'
+ cancelText:
+ description: 'Texte à afficher sur le bouton annuler.'
+ confirmText:
+ description: 'Texte à afficher sur le bouton confirmer.'
+ confirmQuestion:
+ description: 'La question de confirmation à afficher à l\'utilisateur.'
+ isOpen:
+ description: 'Booléen pour contrôler la visibilité de la modale.'
+```
+
+**Règles :**
+- Nom de propriété en camelCase (sans le @)
+- Une description par propriété
+- Descriptions courtes et claires
+- Cohérence entre EN et FR
+
+---
+
+## 🔄 Tableau de correspondance des transformations
+
+| Type | Exemple Input | Transformation | Exemple Output |
+|------|---------------|----------------|----------------|
+| Route name | confirm-modal | kebab-case | `this.route('confirm-modal')` |
+| Route file | confirm-modal | kebab-case | `prefabs/confirm-modal.ts` |
+| Route class | confirm-modal | PascalCase | `DocsEmberUiPrefabsConfirmModalRoute` |
+| Template file | confirm-modal | kebab-case | `prefabs/confirm-modal.gts` |
+| Component file | confirm-modal | kebab-case | `confirm-modal.gts` |
+| Component class | confirm-modal | PascalCase + suffix | `ConfirmModalExample` |
+| Import name | confirm-modal | PascalCase | `ConfirmModalExample` |
+| Menu label | confirm-modal | Title Case + suffix | `Confirm modal prefab` |
+| Route path | confirm-modal | kebab-case | `dashboard.docs.ember-ui.prefabs.confirm-modal` |
+| Translation key | confirm-modal | kebab-case with dots | `ember-ui.prefabs.confirm-modal.title` |
+| Package import | confirm-modal | kebab-case | `@triptyk/ember-ui/components/prefabs/tpk-confirm-modal-prefab` |
+
+---
+
+## ⚠️ Contraintes strictes
+
+### ❌ INTERDIT
+- Créer plusieurs composants de démo (basic, disabled, error) comme pour ember-input-validation
+- Utiliser `@triptyk/ember-input-validation` comme package
+- Ajouter automatiquement des propriétés `@changeset` ou `@validationField` (sauf si explicitement demandé)
+- Utiliser la clé i18n `emberInputValidation`
+- Ajouter "validation" dans les labels de la sidebar
+- Copier la logique métier de confirm-modal pour une autre ressource
+
+### ✅ OBLIGATOIRE
+- Créer UN SEUL composant de démonstration
+- Utiliser `@triptyk/ember-ui` comme package
+- Respecter le format des clés i18n : `ember-ui.prefabs.[resource-name]`
+- Label sidebar : "[Resource Name] prefab" (sans "validation")
+- Créer les traductions dans les deux langues (EN et FR)
+- Respecter l'indentation et la structure existantes
+
+### 🛑 En cas de doute
+**STOP et demander des clarifications**
+
+---
+
+## 📝 Exemple complet : Création de la ressource "tooltip"
+
+**Prompt utilisateur :** "créer la ressource tooltip dans la section ember-ui/prefabs"
+
+### Fichiers à créer :
+
+1. `doc-app/app/routes/dashboard/docs/ember-ui/prefabs/tooltip.ts`
+2. `doc-app/app/templates/dashboard/docs/ember-ui/prefabs/tooltip.gts`
+3. `doc-app/app/components/docs/ember-ui/prefabs/tooltip.gts`
+4. `doc-app/translations/ember-ui/prefabs/tooltip/en-us.yaml`
+5. `doc-app/translations/ember-ui/prefabs/tooltip/fr-fr.yaml`
+
+### Fichiers à modifier :
+
+1. `doc-app/app/router.ts` - Ajouter `this.route('tooltip');`
+2. `doc-app/app/templates/dashboard.gts` - Ajouter l'entrée menu pour tooltip
+3. `doc-app/translations/en-us.yaml` - Ajouter les traductions principales EN
+4. `doc-app/translations/fr-fr.yaml` - Ajouter les traductions principales FR
+
+---
+
+## 🎯 Checklist de validation
+
+Avant de considérer la tâche terminée, vérifier :
+
+- [ ] La route est ajoutée dans `router.ts` (section `ember-ui` > `prefabs`)
+- [ ] Le fichier de route existe avec le bon nom de classe (`DocsEmberUiPrefabs[Resource]Route`)
+- [ ] L'entrée de menu est ajoutée dans `dashboard.gts` (groupe "Ember UI")
+- [ ] Le label du menu est "[Resource] prefab" (SANS "validation")
+- [ ] UN SEUL composant de démo est créé (pas 3)
+- [ ] Le composant de démo utilise `@triptyk/ember-ui`
+- [ ] Le template principal est créé et importe le bon composant
+- [ ] Tous les noms sont adaptés à la nouvelle ressource
+- [ ] Aucun nom d'exemple (confirm-modal) n'apparaît dans les nouveaux fichiers
+- [ ] Les clés i18n suivent le pattern `ember-ui.prefabs.[resource]`
+- [ ] Les fichiers de traduction principaux (en-us.yaml et fr-fr.yaml) sont mis à jour
+- [ ] Les fichiers de traduction de propriétés sont créés (EN et FR)
+- [ ] Les traductions correspondent aux propriétés définies dans la route
+- [ ] L'indentation est cohérente avec le reste du projet
+
+---
+
+## 🔍 Différences récapitulatives ember-input-validation vs ember-ui
+
+### Structure des composants de démo
+
+**ember-input-validation :**
+```
+components/docs/ember-input-validation/prefabs/
+├── basic-input.gts
+├── disabled-input.gts
+└── error-input.gts
+```
+
+**ember-ui :**
+```
+components/docs/ember-ui/prefabs/
+└── confirm-modal.gts
+```
+
+### Labels de la sidebar
+
+**ember-input-validation :**
+```typescript
+{
+ label: 'Input validation prefab',
+ route: 'dashboard.docs.ember-input-validation.prefabs.input',
+}
+```
+
+**ember-ui :**
+```typescript
+{
+ label: 'Confirm modal prefab',
+ route: 'dashboard.docs.ember-ui.prefabs.confirm-modal',
+}
+```
+
+### Clés de traduction
+
+**ember-input-validation :**
+```yaml
+emberInputValidation:
+ prefabs:
+ input:
+ title: 'Input'
+```
+
+**ember-ui :**
+```yaml
+ember-ui:
+ prefabs:
+ confirm-modal:
+ title: 'Confirm Modal'
+```
+
+### Import des packages
+
+**ember-input-validation :**
+```typescript
+import TpkInputPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-input';
+```
+
+**ember-ui :**
+```typescript
+import TpkConfirmModalPrefab from '@triptyk/ember-ui/components/prefabs/tpk-confirm-modal-prefab';
+```
+
+---
+
+## ✨ Conclusion
+
+Ce guide est spécifique aux composants **ember-ui**. Pour les composants **ember-input-validation**, référez-vous au guide "creation doc ressources.instructions.md".
+
+La principale différence réside dans :
+1. Le nombre de composants de démo (1 au lieu de 3)
+2. Les labels (sans "validation")
+3. Les clés i18n (`ember-ui` au lieu de `emberInputValidation`)
+4. Le package importé (`@triptyk/ember-ui`)
diff --git a/.github/instructions/creation doc ressources.instructions.md b/.github/instructions/creation doc ressources.instructions.md
new file mode 100644
index 00000000..295f9da0
--- /dev/null
+++ b/.github/instructions/creation doc ressources.instructions.md
@@ -0,0 +1,542 @@
+
+# 🧠 GUIDE DE CRÉATION D'UNE NOUVELLE RESSOURCE DE DOCUMENTATION
+
+## Rôle de l'agent
+
+Vous êtes un agent IA responsable de la création d'une nouvelle ressource de documentation dans le projet doc-app.
+
+Vous devez strictement suivre les instructions écrites, sans interprétation, sans déduction implicite et sans extrapolation.
+
+Si une information manque, est ambiguë ou contradictoire, vous devez vous arrêter et demander des clarifications.
+
+## Principe fondamental
+
+Le prompt utilisateur suivra toujours ce format :
+
+**"créer la ressource RESOURCE_NAME dans la section SECTION_NAME"**
+
+Par exemple : "A partir de ce context #context créer la ressource checkbox dans la section ember-input-validation/prefabs a partir de #checkbox"
+
+Conséquences obligatoires :
+- Le nom de la ressource est fourni par le prompt (RESOURCE_NAME)
+- La section cible est fournie par le prompt (SECTION_NAME)
+- Ce fichier fournit la structure attendue, les patterns de fichiers, les conventions de routage et les types de composants
+
+⚠️ **Les exemples fournis ci-dessous sont des MODÈLES DE STRUCTURE, pas des définitions fonctionnelles finales**
+
+---
+
+## 📁 Structure du projet doc-app
+
+\`\`\`
+doc-app/
+├── app/
+│ ├── router.ts # Fichier de routage principal
+│ ├── templates/
+│ │ └── dashboard.gts # Template principal avec sidebar
+│ ├── routes/
+│ │ └── dashboard/
+│ │ └── docs/
+│ │ └── [section]/
+│ │ └── prefabs/
+│ │ └── [resource].ts # Fichier de route
+│ ├── templates/
+│ │ └── dashboard/
+│ │ └── docs/
+│ │ └── [section]/
+│ │ └── prefabs/
+│ │ └── [resource].gts # Template de la page
+│ └── components/
+│ └── docs/
+│ └── [section]/
+│ └── prefabs/
+│ ├── basic-[resource].gts
+│ ├── disabled-[resource].gts
+│ └── error-[resource].gts
+│
+└── translations/
+│ ├── en-us.yaml
+│ └── [section]/
+│ └── prefabs/
+| └── [resource]/en-us.yaml
+\`\`\`
+
+---
+
+## Tâches à effectuer (ordre obligatoire)
+
+### 1️⃣ Création de la route
+
+**Fichier à créer :**
+\`\`\`
+doc-app/app/routes/dashboard/docs/[SECTION_NAME]/prefabs/[RESOURCE_NAME].ts
+\`\`\`
+
+**Structure exacte :**
+\`\`\`typescript
+// doc-app/app/routes/docs/[section-name]/prefabs/[resource-name].ts
+import Route from '@ember/routing/route';
+
+export default class Docs[SectionName]Prefabs[ResourceName]Route extends Route {
+ model() {
+ return {
+ properties: [
+ {
+ name: '@validationField',
+ type: 'string',
+ required: true,
+ description: '[section-key].prefabs.[resource-name].properties.validationField.description',
+ },
+ {
+ name: '@changeset',
+ type: 'ImmerChangeset',
+ required: true,
+ description: '[section-key].prefabs.[resource-name].properties.changeset.description',
+ },
+ {
+ name: '@label',
+ type: 'string',
+ required: false,
+ description: '[section-key].prefabs.[resource-name].properties.label.description',
+ },
+ {
+ name: '@placeholder',
+ type: 'string',
+ required: false,
+ description: '[section-key].prefabs.[resource-name].properties.placeholder.description',
+ },
+ // Ajouter les autres propriétés spécifiques à la ressource
+ ],
+ };
+ }
+}
+\`\`\`
+
+**Règles de nommage :**
+- Classe : \`Docs\` + PascalCase(section) + \`Prefabs\` + PascalCase(resource) + \`Route\`
+- Clés i18n : \`[section-kebab-case].prefabs.[resource-kebab-case].properties.[property-name].description\`
+
+---
+
+### 2️⃣ Modification du router.ts
+
+**Fichier à modifier :** \`doc-app/app/router.ts\`
+
+**Localisation exacte :** Dans la fonction \`Router.map()\`, sous la section correspondante
+
+**Exemple avant :**
+\`\`\`typescript
+Router.map(function () {
+ this.route('dashboard', { path: '/' }, function () {
+ this.route('docs', function () {
+ this.route('ember-input-validation', function () {
+ this.route('prefabs', function () {
+ this.route('input');
+ this.route('number');
+ });
+ });
+ });
+ });
+});
+\`\`\`
+
+**Exemple après (ajout de 'checkbox') :**
+\`\`\`typescript
+Router.map(function () {
+ this.route('dashboard', { path: '/' }, function () {
+ this.route('docs', function () {
+ this.route('ember-input-validation', function () {
+ this.route('prefabs', function () {
+ this.route('input');
+ this.route('number');
+ this.route('checkbox'); // ← NOUVELLE ROUTE
+ });
+ });
+ });
+ });
+});
+\`\`\`
+
+**Contraintes strictes :**
+- Respecter l'indentation existante
+- Ne modifier aucune autre route
+- Ajouter la nouvelle route à la fin de la section concernée
+
+---
+
+### 3️⃣ Ajout dans la Sidebar
+
+**Fichier à modifier :** \`doc-app/app/templates/dashboard.gts\`
+
+**Structure de l'entrée :**
+\`\`\`typescript
+menuItems = [
+ // ... entrées existantes
+ {
+ label: '[Resource Name] validation prefab',
+ route: 'dashboard.docs.[section-name].prefabs.[resource-name]',
+ tooltip: '[Resource Name] validation prefab',
+ },
+];
+\`\`\`
+
+**Exemple concret pour 'checkbox' dans 'ember-input-validation' :**
+\`\`\`typescript
+menuItems = [
+ {
+ label: 'Input validation prefab',
+ route: 'dashboard.docs.ember-input-validation.prefabs.input',
+ tooltip: 'Input validation prefab',
+ },
+ {
+ label: 'Number validation prefab',
+ route: 'dashboard.docs.ember-input-validation.prefabs.number',
+ tooltip: 'Number validation prefab',
+ },
+ {
+ label: 'Checkbox validation prefab', // ← NOUVELLE ENTRÉE
+ route: 'dashboard.docs.ember-input-validation.prefabs.checkbox',
+ tooltip: 'Checkbox validation prefab',
+ },
+];
+\`\`\`
+
+---
+
+### 4️⃣ Création des composants de démonstration
+
+**Dossier de création :**
+\`\`\`
+doc-app/app/components/docs/[section-name]/prefabs/
+\`\`\`
+
+**Composants obligatoires à créer :**
+
+#### a) basic-[resource-name].gts
+\`\`\`typescript
+// doc-app/app/components/docs/[section-name]/prefabs/basic-[resource-name].gts
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import Tpk[ResourceName]Prefab from '@triptyk/[package-name]/components/prefabs/tpk-validation-[resource-name]';
+
+export default class Basic[ResourceName]Example extends Component {
+ @tracked changeset = new ImmerChangeset({
+ something: '', // Adapter selon le type de donnée
+ });
+
+
+
+
+}
+\`\`\`
+
+#### b) disabled-[resource-name].gts
+\`\`\`typescript
+// doc-app/app/components/docs/[section-name]/prefabs/disabled-[resource-name].gts
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import Tpk[ResourceName]Prefab from '@triptyk/[package-name]/components/prefabs/tpk-validation-[resource-name]';
+
+export default class Disabled[ResourceName]Example extends Component {
+ @tracked changeset = new ImmerChangeset({
+ disabled: 'This is disabled', // Adapter selon le type
+ });
+
+
+
+
+}
+\`\`\`
+
+#### c) error-[resource-name].gts
+\`\`\`typescript
+// doc-app/app/components/docs/[section-name]/prefabs/error-[resource-name].gts
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import Tpk[ResourceName]Prefab from '@triptyk/[package-name]/components/prefabs/tpk-validation-[resource-name]';
+import type Owner from '@ember/owner';
+import { action } from '@ember/object';
+
+export default class Error[ResourceName]Example extends Component {
+ @tracked changeset = new ImmerChangeset({
+ something: '', // Adapter selon le type
+ });
+
+ @action
+ onChange(value: string | number | Date | null) {
+ // Logique de validation d'exemple
+ // Adapter selon les règles métier de la ressource
+
+ if (typeof value !== 'string') {
+ this.changeset.addError({
+ message: 'should be a string value',
+ value: 'err',
+ originalValue: '',
+ key: 'something',
+ });
+ }
+ if ((value as string)?.length >= 5) {
+ this.changeset.removeErrors();
+ } else {
+ this.changeset.addError({
+ message: 'Minimum 5 characters',
+ value: 'err',
+ originalValue: '',
+ key: 'something',
+ });
+ }
+ }
+
+ constructor(owner: Owner, args: never) {
+ super(owner, args);
+ setTimeout(() => {
+ this.changeset.addError({
+ message: 'Minimum 5 characters',
+ value: 'err',
+ originalValue: '',
+ key: 'something',
+ });
+ }, 0);
+ }
+
+
+
+
+}
+\`\`\`
+
+**Conventions de nommage des composants :**
+- Fichiers : kebab-case (ex: \`basic-input.gts\`, \`error-checkbox.gts\`)
+- Classes : PascalCase (ex: \`BasicInputExample\`, \`ErrorCheckboxExample\`)
+- Pattern : \`[Type][ResourceName]Example\`
+
+---
+
+### 5️⃣ Création du template de route principal
+
+**Fichier à créer :**
+\`\`\`
+doc-app/app/templates/dashboard/docs/[section-name]/prefabs/[resource-name].gts
+\`\`\`
+
+**Structure exacte :**
+\`\`\`typescript
+import Component from '@glimmer/component';
+import DocPage from 'doc-app/components/doc/page';
+import DocSection from 'doc-app/components/doc/section';
+import DocPropertyTable from 'doc-app/components/doc/property-table';
+import { t, type IntlService } from 'ember-intl';
+import Basic[ResourceName]Example from 'doc-app/components/docs/[section-name]/prefabs/basic-[resource-name].gts';
+import Disabled[ResourceName]Example from 'doc-app/components/docs/[section-name]/prefabs/disabled-[resource-name].gts';
+import Error[ResourceName]Example from 'doc-app/components/docs/[section-name]/prefabs/error-[resource-name].gts';
+import { service } from '@ember/service';
+import CodeExampleComponent from 'doc-app/components/doc/code-example.gts';
+import CodeBlock from 'doc-app/components/doc/code-block.gts';
+
+interface Property {
+ name: string;
+ type: string;
+ required: boolean;
+ description: string;
+}
+
+interface [ResourceName]PrefabDocsSignature {
+ Args: {
+ model: {
+ properties: Property[];
+ };
+ };
+}
+
+export default class [ResourceName]PrefabDocs extends Component<[ResourceName]PrefabDocsSignature> {
+ @service declare intl: IntlService;
+
+ [resourceName] = \`
+
+ \`;
+
+
+
+
+
+ <:demo>
+
+
+
+
+
+
+ <:template>
+
+
+
+
+
+
+
+
+
+}
+\`\`\`
+
+**Règles pour le template :**
+- Classe : PascalCase de la ressource + \`PrefabDocs\`
+- Signature : Interface nommée \`[ResourceName]PrefabDocsSignature\`
+- Importer UNIQUEMENT les composants créés (basic, disabled, error)
+- Variable de code : nom de la ressource en camelCase
+- Clés i18n : \`[sectionKey].prefabs.[resourceName].[sous-section]\`
+
+---
+
+### 6️⃣ Ajout des traductions
+
+**Fichier à modifier :** \`doc-app/translations/en-us.yaml\`
+
+**Structure à ajouter :**
+\`\`\`yaml
+[sectionKey]:
+ prefabs:
+ [resourceName]:
+ title: '[Resource Name]'
+ description: 'Description courte et claire du composant de validation'
+ examples:
+ title: 'Examples'
+ basic: 'Basic usage'
+\`\`\`
+
+**Exemple concret pour 'checkbox' dans 'ember-input-validation' :**
+\`\`\`yaml
+emberInputValidation:
+ prefabs:
+ checkbox:
+ title: 'Checkbox'
+ description: 'A reusable validation component for checkboxes with integrated error handling'
+ examples:
+ title: 'Examples'
+ basic: 'Basic usage'
+\`\`\`
+
+**Règles pour les traductions :**
+- Clé de section : camelCase du nom de la section (ex: \`emberInputValidation\`)
+- Clé de ressource : camelCase du nom de la ressource (ex: \`checkbox\`)
+- Structure obligatoire : \`title\`, \`description\`, \`examples.title\`, \`examples.basic\`
+- **NE PAS ajouter de section \`properties\`** - les descriptions des propriétés sont dans le fichier de route
+- Le \`title\` est juste le nom de la ressource (sans "validation prefab")
+- La \`description\` explique brièvement l'utilité du composant
+- \`examples.title\` doit toujours être "Examples"
+- \`examples.basic\` doit toujours être "Basic usage"
+- Format : Respecter l'indentation YAML (2 espaces)
+
+**Placement dans le fichier :**
+- Localiser la section correspondante (ex: \`emberInputValidation\`)
+- Si la section n'existe pas, la créer en respectant l'ordre alphabétique
+- Ajouter \`prefabs\` si non existant
+- Ajouter la ressource en ordre alphabétique sous \`prefabs\`
+
+**⚠️ IMPORTANT :** Les descriptions des propriétés (@validationField, @changeset, etc.) sont définies dans le fichier de route (routes/dashboard/docs/[section]/prefabs/[resource].ts) et NON dans le fichier YAML
+
+---
+
+## 🔄 Tableau de correspondance des transformations
+
+| Type | Exemple Input | Transformation | Exemple Output |
+|------|---------------|----------------|----------------|
+| Route name | checkbox | kebab-case | \`this.route('checkbox')\` |
+| Route file | checkbox | kebab-case | \`prefabs/checkbox.ts\` |
+| Route class | checkbox | PascalCase | \`DocsEmberInputValidationPrefabsCheckboxRoute\` |
+| Template file | checkbox | kebab-case | \`prefabs/checkbox.gts\` |
+| Component file | checkbox | kebab-case + prefix | \`basic-checkbox.gts\` |
+| Component class | checkbox | PascalCase + suffix | \`BasicCheckboxExample\` |
+| Import name | checkbox | PascalCase | \`BasicCheckboxExample\` |
+| Menu label | checkbox | Title Case + suffix | \`Checkbox validation prefab\` |
+| Route path | checkbox | kebab-case | \`dashboard.docs.ember-input-validation.prefabs.checkbox\` |
+| Section i18n key | ember-input-validation | camelCase | \`emberInputValidation\` |
+| Resource i18n key | checkbox | camelCase | \`checkbox\` |
+| Translation key | checkbox | camelCase with dots | \`emberInputValidation.prefabs.checkbox.title\` |
+
+---
+
+## ⚠️ Contraintes strictes
+
+### ❌ INTERDIT
+- Réutiliser les noms de ressources des exemples (input, number)
+- Copier les données métier des exemples
+- Inventer une logique en dehors du contexte
+- Créer des composants supplémentaires non mentionnés
+- Modifier d'autres routes que celle créée
+
+### ✅ OBLIGATOIRE
+- Remplacer TOUS les éléments dépendants de la ressource
+- Respecter l'indentation et la structure existantes
+- Suivre les conventions de nommage décrites
+- Créer exactement 3 composants de démonstration (basic, disabled, error)
+- Importer uniquement les composants créés
+
+### 🛑 En cas de doute
+**STOP et demander des clarifications**
+
+---
+
+## 📝 Exemple complet : Création de la ressource "select"
+
+**Prompt utilisateur :** "créer la ressource select dans la section ember-input-validation/prefabs"
+
+### Fichiers à créer :
+
+1. \`doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/select.ts\`
+2. \`doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/select.gts\`
+3. \`doc-app/app/components/docs/ember-input-validation/prefabs/basic-select.gts\`
+4. \`doc-app/app/components/docs/ember-input-validation/prefabs/disabled-select.gts\`
+5. \`doc-app/app/components/docs/ember-input-validation/prefabs/error-select.gts\`
+
+### Fichiers à modifier :
+
+1. \`doc-app/app/router.ts\` - Ajouter \`this.route('select');\`
+2. \`doc-app/app/templates/dashboard.gts\` - Ajouter l'entrée menu pour select
+3. \`doc-app/translations/en-us.yaml\` - Ajouter les traductions pour select
+
+---
+
+## 🎯 Checklist de validation
+
+Avant de considérer la tâche terminée, vérifier :
+
+- [ ] La route est ajoutée dans \`router.ts\`
+- [ ] Le fichier de route existe avec le bon nom de classe
+- [ ] L'entrée de menu est ajoutée dans \`dashboard.gts\`
+- [ ] Les 3 composants de démo sont créés (basic, disabled, error)
+- [ ] Le template principal est créé et importe les bons composants
+- [ ] Tous les noms sont adaptés à la nouvelle ressource
+- [ ] Aucun nom d'exemple (input, number) n'apparaît dans les nouveaux fichiers
+- [ ] Les clés i18n suivent le pattern correct
+- [ ] Le fichier de traduction \`en-us.yaml\` est mis à jour avec toutes les clés nécessaires
+- [ ] Les traductions correspondent exactement aux propriétés définies dans la route
+- [ ] L'indentation est cohérente avec le reste du projet
\ No newline at end of file
diff --git a/.github/workflows/publish-dist.yaml b/.github/workflows/publish-dist.yaml
index 87d6b845..4e5f1989 100644
--- a/.github/workflows/publish-dist.yaml
+++ b/.github/workflows/publish-dist.yaml
@@ -5,6 +5,7 @@ on:
branches:
- main
- develop
+ - upgrade-ember
jobs:
push-dist:
diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml
index 018e453c..6596d39b 100644
--- a/.github/workflows/tests.yaml
+++ b/.github/workflows/tests.yaml
@@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v4
- uses: wyvox/action-setup-pnpm@v3
- name: Build
- run: pnpm turbo build
+ run: pnpm turbo build --filter='@triptyk/ember-*'
- name: Run tests
run: pnpm turbo lint test
deploy:
@@ -25,12 +25,12 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v2
with:
- node-version: 20
+ node-version: 22
registry-url: https://registry.npmjs.org/
scope: "@triptyk"
- uses: wyvox/action-setup-pnpm@v3
with:
- node-version: 20
+ node-version: 22
- run: pnpm recursive publish --access=public --tag=beta
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
diff --git a/.gitignore b/.gitignore
index 01315312..1561d525 100644
--- a/.gitignore
+++ b/.gitignore
@@ -107,4 +107,7 @@ dist
# Sorry Triptyk, i'm a vim guy :c
*.swo
-*.swp
+*.swp
+
+# macOS system files
+.DS_Store
diff --git a/.vscode/mcp.json b/.vscode/mcp.json
new file mode 100644
index 00000000..6df9c17c
--- /dev/null
+++ b/.vscode/mcp.json
@@ -0,0 +1,3 @@
+{
+ "servers": {}
+}
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 983d9911..cdf0fd12 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -4,7 +4,7 @@
"editor.formatOnSave": true
},
"[glimmer-ts]": {
- "editor.defaultFormatter": "esbenp.prettier-vscode",
+ "editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.formatOnSave": true
},
"editor.formatOnSave": true,
@@ -24,6 +24,5 @@
},
"[typescript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
- },
- "eslint.validate": ["glimmer-ts", "glimmer-js"]
+ }
}
diff --git a/README.md b/README.md
index 588f3c7c..899c9a0f 100644
--- a/README.md
+++ b/README.md
@@ -20,4 +20,30 @@ All the tests are in the `doc-app`.
## Disclaimer
-Versions *0.X.X* does not follow SemVer.
\ No newline at end of file
+Versions *0.X.X* does not follow SemVer.
+
+
+## Architecture
+
+```
+doc-app/
+ app/
+ routes/
+ docs/
+ ember-input-validation/
+ prefabs/
+ input.ts # Route qui charge les données
+ templates/
+ docs/
+ ember-input-validation/
+ prefabs/
+ input.hbs # Template de la page
+ components/
+ doc-page.gts # Layout principal de page doc
+ code-example.gts # Composant avec onglets Template/Result/Code
+ usage-example.gts # Wrapper pour les exemples
+ markdown-content.gts # Pour le contenu texte (optionnel)
+ translations/
+ en-us.yaml
+ fr-fr.yaml
+```
diff --git a/doc-app/.ember-cli b/doc-app/.ember-cli
index 4defd284..a37e45fa 100644
--- a/doc-app/.ember-cli
+++ b/doc-app/.ember-cli
@@ -3,5 +3,17 @@
Setting `isTypeScriptProject` to true will force the blueprint generators to generate TypeScript
rather than JavaScript by default, when a TypeScript version of a given blueprint is available.
*/
- "isTypeScriptProject": true
+ "isTypeScriptProject": true,
+
+ /**
+ Setting `componentAuthoringFormat` to "strict" will force the blueprint generators to generate GJS
+ or GTS files for the component and the component rendering test. "loose" is the default.
+ */
+ "componentAuthoringFormat": "strict",
+
+ /**
+ Setting `routeAuthoringFormat` to "strict" will force the blueprint generators to generate GJS
+ or GTS templates for routes. "loose" is the default
+ */
+ "routeAuthoringFormat": "strict"
}
diff --git a/doc-app/.env.development b/doc-app/.env.development
new file mode 100644
index 00000000..f3289142
--- /dev/null
+++ b/doc-app/.env.development
@@ -0,0 +1,8 @@
+# This file is committed to git and should not contain any secrets.
+#
+# Vite recommends using .env.local or .env.[mode].local if you need to manage secrets
+# SEE: https://vite.dev/guide/env-and-mode.html#env-files for more information.
+
+
+# Default NODE_ENV with vite build --mode=test is production
+NODE_ENV=development
diff --git a/doc-app/.eslintignore b/doc-app/.eslintignore
deleted file mode 100644
index 768fab33..00000000
--- a/doc-app/.eslintignore
+++ /dev/null
@@ -1,14 +0,0 @@
-# unconventional js
-/blueprints/*/files/
-
-# compiled output
-/declarations/
-/dist/
-
-# misc
-/coverage/
-!.*
-.*/
-
-# ember-try
-/.node_modules.ember-try/
diff --git a/doc-app/.eslintrc.js b/doc-app/.eslintrc.js
deleted file mode 100644
index ba178f1e..00000000
--- a/doc-app/.eslintrc.js
+++ /dev/null
@@ -1,63 +0,0 @@
-// .eslintrc.js
-module.exports = {
- overrides: [
- {
- files: ['**/*.{js,ts}'],
- plugins: ['ember'],
- parser: '@typescript-eslint/parser',
- extends: [
- 'eslint:recommended',
- 'plugin:ember/recommended', // or other configuration
- ],
- rules: {
- // override / enable optional rules
- 'ember/no-replace-test-comments': 'error',
- 'no-unused-vars': 'off',
- 'no-undef': 'off',
- }
- },
- {
- files: ['**/*.gts'],
- parser: 'ember-eslint-parser',
- plugins: ['ember'],
- extends: [
- 'eslint:recommended',
- 'plugin:@typescript-eslint/recommended',
- 'plugin:ember/recommended',
- 'plugin:ember/recommended-gts',
- ],
- },
- {
- files: ['**/*.gjs'],
- parser: 'ember-eslint-parser',
- plugins: ['ember'],
- extends: [
- 'eslint:recommended',
- 'plugin:ember/recommended',
- 'plugin:ember/recommended-gjs',
- ],
- },
- {
- files: ['tests/**/*.{js,ts,gjs,gts}'],
- rules: {
- // override / enable optional rules
- 'ember/no-replace-test-comments': 'error',
- 'no-unused-vars': 'off',
- 'no-undef': 'off',
- }
- },
- {
- files: [
- '*.js'
- ],
- env: {
- node: true
- },
- rules: {
- // rules specific to nodejs files
- 'no-console': 'off',
- 'strict': ['error', 'global']
- }
- }
- ],
-};
diff --git a/doc-app/.github/workflows/ci.yml b/doc-app/.github/workflows/ci.yml
new file mode 100644
index 00000000..5494bdcf
--- /dev/null
+++ b/doc-app/.github/workflows/ci.yml
@@ -0,0 +1,53 @@
+name: CI
+
+on:
+ push:
+ branches:
+ - main
+ - master
+ pull_request: {}
+
+concurrency:
+ group: ci-${{ github.head_ref || github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ lint:
+ name: "Lint"
+ runs-on: ubuntu-latest
+ timeout-minutes: 10
+
+ steps:
+ - uses: actions/checkout@v3
+ - uses: pnpm/action-setup@v4
+ with:
+ version: 9
+ - name: Install Node
+ uses: actions/setup-node@v3
+ with:
+ node-version: 18
+ cache: pnpm
+ - name: Install Dependencies
+ run: pnpm install --frozen-lockfile
+ - name: Lint
+ run: pnpm lint
+
+ test:
+ name: "Test"
+ runs-on: ubuntu-latest
+ timeout-minutes: 10
+
+ steps:
+ - uses: actions/checkout@v3
+ - uses: pnpm/action-setup@v4
+ with:
+ version: 9
+ - name: Install Node
+ uses: actions/setup-node@v3
+ with:
+ node-version: 18
+ cache: pnpm
+ - name: Install Dependencies
+ run: pnpm install --frozen-lockfile
+ - name: Run Tests
+ run: pnpm test
diff --git a/doc-app/.gitignore b/doc-app/.gitignore
index 71ad79d0..b4554042 100644
--- a/doc-app/.gitignore
+++ b/doc-app/.gitignore
@@ -1,12 +1,13 @@
# compiled output
/dist/
/declarations/
+/tmp/
# dependencies
/node_modules/
# misc
-/.env*
+*.local
/.pnp*
/.eslintcache
/coverage/
diff --git a/doc-app/.prettierignore b/doc-app/.prettierignore
index 9385391f..c2a4e423 100644
--- a/doc-app/.prettierignore
+++ b/doc-app/.prettierignore
@@ -4,10 +4,13 @@
# compiled output
/dist/
+# generated
+public/mockServiceWorker.js
+
# misc
/coverage/
!.*
.*/
-
-# ember-try
-/.node_modules.ember-try/
+/pnpm-lock.yaml
+ember-cli-update.json
+*.html
diff --git a/doc-app/.prettierrc.js b/doc-app/.prettierrc.js
deleted file mode 100644
index 21dbe8b4..00000000
--- a/doc-app/.prettierrc.js
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-module.exports = {
- overrides: [
- {
- files: '*.{js,ts}',
- options: {
- singleQuote: true,
- },
- },
- ],
-};
diff --git a/doc-app/.prettierrc.mjs b/doc-app/.prettierrc.mjs
new file mode 100644
index 00000000..de1d43fb
--- /dev/null
+++ b/doc-app/.prettierrc.mjs
@@ -0,0 +1,37 @@
+export default {
+ plugins: ['prettier-plugin-ember-template-tag'],
+ singleQuote: true,
+ overrides: [
+ {
+ files: ['*.js', '*.ts', '*.cjs', '.mjs', '.cts', '.mts', '.cts'],
+ options: {
+ trailingComma: 'es5',
+ },
+ },
+ {
+ files: ['*.html'],
+ options: {
+ singleQuote: false,
+ },
+ },
+ {
+ files: ['*.json'],
+ options: {
+ singleQuote: false,
+ },
+ },
+ {
+ files: ['*.hbs'],
+ options: {
+ singleQuote: false,
+ },
+ },
+ {
+ files: ['*.gjs', '*.gts'],
+ options: {
+ templateSingleQuote: false,
+ trailingComma: 'es5',
+ },
+ },
+ ],
+};
diff --git a/doc-app/.stylelintignore b/doc-app/.stylelintignore
deleted file mode 100644
index a0cf71cb..00000000
--- a/doc-app/.stylelintignore
+++ /dev/null
@@ -1,8 +0,0 @@
-# unconventional files
-/blueprints/*/files/
-
-# compiled output
-/dist/
-
-# addons
-/.node_modules.ember-try/
diff --git a/doc-app/.stylelintrc.js b/doc-app/.stylelintrc.js
deleted file mode 100644
index 0f9632c4..00000000
--- a/doc-app/.stylelintrc.js
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-module.exports = {
- extends: ['stylelint-config-standard', 'stylelint-prettier/recommended'],
-};
diff --git a/doc-app/.template-lintrc.js b/doc-app/.template-lintrc.mjs
similarity index 58%
rename from doc-app/.template-lintrc.js
rename to doc-app/.template-lintrc.mjs
index cedfc014..589ce8f7 100644
--- a/doc-app/.template-lintrc.js
+++ b/doc-app/.template-lintrc.mjs
@@ -1,5 +1,3 @@
-
-
-module.exports = {
+export default {
extends: 'recommended',
};
diff --git a/doc-app/CHANGELOG.md b/doc-app/CHANGELOG.md
deleted file mode 100644
index 1c4b1648..00000000
--- a/doc-app/CHANGELOG.md
+++ /dev/null
@@ -1,165 +0,0 @@
-# Change Log
-
-All notable changes to this project will be documented in this file.
-See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-
-## [3.0.1](https://github.com/TRIPTYK/ember-common-ui/compare/v3.0.0...v3.0.1) (2026-01-14)
-
-
-### Features
-
-* add index as param for yield and give info if stack is open for button delete ([c25dda6](https://github.com/TRIPTYK/ember-common-ui/commit/c25dda67800d515d7b5208e421d90e7a95aa619c))
-
-
-
-
-
-# [3.0.0](https://github.com/TRIPTYK/ember-common-ui/compare/v3.0.0-alpha.13...v3.0.0) (2025-04-18)
-
-**Note:** Version bump only for package doc-app
-
-
-
-
-
-# [3.0.0-alpha.13](https://github.com/TRIPTYK/ember-common-ui/compare/v3.0.0-alpha.12...v3.0.0-alpha.13) (2025-02-03)
-
-
-### Bug Fixes
-
-* element pass by function ([9baa96d](https://github.com/TRIPTYK/ember-common-ui/commit/9baa96d1e64e38c9b74974c613264f272bb0fb83))
-* review ([2b3125b](https://github.com/TRIPTYK/ember-common-ui/commit/2b3125b8972474f87ce1ac959a312e9f154cb86b))
-
-
-
-
-
-# [3.0.0-alpha.12](https://github.com/TRIPTYK/ember-common-ui/compare/v3.0.0-alpha.11...v3.0.0-alpha.12) (2025-01-27)
-
-
-### Bug Fixes
-
-* debug table generic prefab ([7364795](https://github.com/TRIPTYK/ember-common-ui/commit/7364795ca2edd05bafc51c8e80e048f87710bbd9))
-
-
-
-
-
-# [3.0.0-alpha.11](https://github.com/TRIPTYK/ember-common-ui/compare/v3.0.0-alpha.10...v3.0.0-alpha.11) (2025-01-24)
-
-
-### Features
-
-* add prefab file list with dropzone ([d9b682c](https://github.com/TRIPTYK/ember-common-ui/commit/d9b682cc725b5c536513795f5abf5dcf039a0000))
-* add tpk-search input ([0c56a9d](https://github.com/TRIPTYK/ember-common-ui/commit/0c56a9d80273a8cd0b2b8dc5a4802ac39302527d))
-* button prefab ([b5391df](https://github.com/TRIPTYK/ember-common-ui/commit/b5391df3a08f4eea3c9972d991d81a2598b69cfc))
-* confirm modal prefab ([0a01c33](https://github.com/TRIPTYK/ember-common-ui/commit/0a01c3341e1ab7bfb025fcb80f5b69ad4c037847))
-* confirm modal prefab ([918a38a](https://github.com/TRIPTYK/ember-common-ui/commit/918a38a6938d70e1ae5a329a57f5342be51dbe84))
-* remove tpk-stepper ([ea85b32](https://github.com/TRIPTYK/ember-common-ui/commit/ea85b32199f8459089989910aeb8f82ceb8161bc))
-* review ([149121f](https://github.com/TRIPTYK/ember-common-ui/commit/149121fe856b11809784d0ac69fb021c05dabd0c))
-* toggle switch ([6206fd4](https://github.com/TRIPTYK/ember-common-ui/commit/6206fd4035caa13ea83ffb864f37a983c9b6fe38))
-
-
-
-
-
-# [3.0.0-alpha.10](https://github.com/TRIPTYK/ember-common-ui/compare/v3.0.0-alpha.9...v3.0.0-alpha.10) (2024-12-06)
-
-**Note:** Version bump only for package doc-app
-
-
-
-
-
-# [3.0.0-alpha.9](https://github.com/TRIPTYK/ember-common-ui/compare/v3.0.0-alpha.8...v3.0.0-alpha.9) (2024-12-06)
-
-**Note:** Version bump only for package doc-app
-
-
-
-
-
-# [3.0.0-alpha.8](https://github.com/TRIPTYK/ember-common-ui/compare/v3.0.0-alpha.7...v3.0.0-alpha.8) (2024-12-06)
-
-
-### Bug Fixes
-
-* css file for datepicker icon ([909c051](https://github.com/TRIPTYK/ember-common-ui/commit/909c05139f7966f799b800a7db6c70e8df858e69))
-
-
-
-
-
-# [3.0.0-alpha.7](https://github.com/TRIPTYK/ember-common-ui/compare/v3.0.0-alpha.6...v3.0.0-alpha.7) (2024-12-05)
-
-**Note:** Version bump only for package doc-app
-
-
-
-
-
-# [3.0.0-alpha.6](https://github.com/TRIPTYK/ember-common-ui/compare/v3.0.0-alpha.5...v3.0.0-alpha.6) (2024-12-05)
-
-
-### Bug Fixes
-
-* bic, iban & vat return uppercase automaticly ([8c8cd3b](https://github.com/TRIPTYK/ember-common-ui/commit/8c8cd3b080dd5126c7fb55a0f5c5d62976867a0d))
-
-
-
-
-
-# [3.0.0-alpha.5](https://github.com/TRIPTYK/ember-common-ui/compare/v3.0.0-alpha.3...v3.0.0-alpha.5) (2024-12-03)
-
-**Note:** Version bump only for package doc-app
-
-
-
-
-
-# [3.0.0-alpha.4](https://github.com/TRIPTYK/ember-common-ui/compare/v3.0.0-alpha.3...v3.0.0-alpha.4) (2024-12-03)
-
-**Note:** Version bump only for package doc-app
-
-
-
-
-
-# [3.0.0-alpha.3](https://github.com/TRIPTYK/ember-common-ui/compare/v3.0.0-alpha.2...v3.0.0-alpha.3) (2024-12-03)
-
-
-### Bug Fixes
-
-* make good for a11y and let just one theme to build faster daisy ([9de5e05](https://github.com/TRIPTYK/ember-common-ui/commit/9de5e05b1adcef966658d53527e77b9b85b34854))
-* missing disabled ([ef7bb35](https://github.com/TRIPTYK/ember-common-ui/commit/ef7bb35c6722fe2c6bf5dd95a86b0f6a5e8e5509))
-* mobile number is not reset when change other input in form ([23566a4](https://github.com/TRIPTYK/ember-common-ui/commit/23566a496b8a68961947d33cebd8eaf115d4c6d3))
-* remove question mark in parameter ([127f0b2](https://github.com/TRIPTYK/ember-common-ui/commit/127f0b214bc415e66dabbf783d5eb8861061bd36))
-* test for tpk-validation-mobile ([16bfb19](https://github.com/TRIPTYK/ember-common-ui/commit/16bfb19959cbaa4b047a4d278af8daf86efabab8))
-* updated not update ([a59cf21](https://github.com/TRIPTYK/ember-common-ui/commit/a59cf211e2441393f2ebbe7a79f3a5e70ba696f6))
-
-
-### Features
-
-* add a11y on prefb number ([f27cc9e](https://github.com/TRIPTYK/ember-common-ui/commit/f27cc9e55536d237cc332072cef44b532e9e5472))
-* add a11y on prefb radio ([cf5d47e](https://github.com/TRIPTYK/ember-common-ui/commit/cf5d47e0a4f7fb899747af02174c1006c71763ac))
-* add daisyui ([fce98a6](https://github.com/TRIPTYK/ember-common-ui/commit/fce98a6d2d3aee0f864088193a3f21dcdafa0d88))
-* add default design with daisy for mobile prefab and add right class on prefab mobile ([a7f3a7b](https://github.com/TRIPTYK/ember-common-ui/commit/a7f3a7bc5bf5deb7cff451c3d9e8843b86828f7e))
-* add default design with daisy for select create prefab ([68bd7a4](https://github.com/TRIPTYK/ember-common-ui/commit/68bd7a4a5dc61edc34a7fba7ca6f534a6ddd44c6))
-* add default design with daisy for select prefab ([dc5d513](https://github.com/TRIPTYK/ember-common-ui/commit/dc5d513e3603deecaf549986b1bdb1af54b159c5))
-* add default design with daisy for select search prefab ([041eb36](https://github.com/TRIPTYK/ember-common-ui/commit/041eb36afc138fda0d8bc9f40052b78d56c2cb46))
-* add prefab for datepicker ([bb4875c](https://github.com/TRIPTYK/ember-common-ui/commit/bb4875c53b6e82ad5890f99b851ed4c5d7d336c7))
-* daisy on bic ([619f069](https://github.com/TRIPTYK/ember-common-ui/commit/619f0698e414eeeb1399f4fd8e6e9be2c30a9e9b))
-* daisy on date picker range and currency ([654a5ac](https://github.com/TRIPTYK/ember-common-ui/commit/654a5ac31f8a566bd88de9a8d84295b5413fcaea))
-* daisy on email, file and iban prefab ([7daea16](https://github.com/TRIPTYK/ember-common-ui/commit/7daea16d8ac59fed1af944ca3890c9ded5ebd924))
-* daisyUI checkbox and input ([9d47dc1](https://github.com/TRIPTYK/ember-common-ui/commit/9d47dc1a8b48df7fedcf2706a3f6d5569d83a009))
-* daisyUI checkbox and input ([f095aa4](https://github.com/TRIPTYK/ember-common-ui/commit/f095aa4fe4520d5c5ccb5224b05e84345ab1f5d3))
-* daisyui for integer input ([57de733](https://github.com/TRIPTYK/ember-common-ui/commit/57de733126c6802a87df375d2d8f3a3415d979d2))
-* daisyui input number ([65b37ad](https://github.com/TRIPTYK/ember-common-ui/commit/65b37ade0ba9ec06408e3d0d00f2d31f583559a7))
-* daisyui national number prefab ([1b3df89](https://github.com/TRIPTYK/ember-common-ui/commit/1b3df895c231e01c33568dbeb126234dd6e58bb1))
-* daisyUI on prefab bic ([4e26577](https://github.com/TRIPTYK/ember-common-ui/commit/4e265774f9cad0bad5ea5902b6085ebe02e7f8c0))
-* daisyui radio-group prefab ([dae07b6](https://github.com/TRIPTYK/ember-common-ui/commit/dae07b60948852da9770d37de13a1086dc06d289))
-* input vat ([d1b1c38](https://github.com/TRIPTYK/ember-common-ui/commit/d1b1c3810fda38b106721d8fa984bdfa5da16fe4))
-* prefab password daisyui ([61e0be5](https://github.com/TRIPTYK/ember-common-ui/commit/61e0be57c55170d72210ba44e928d6d6616f598b))
-* remove classless feature ([dfed3d7](https://github.com/TRIPTYK/ember-common-ui/commit/dfed3d7226288bc84824f72f8f69174380604d97))
-* review ([1eea468](https://github.com/TRIPTYK/ember-common-ui/commit/1eea468820144f45eb0015b3635bbfffceb15968))
-* textarea prefab daisyui ([6bb6a22](https://github.com/TRIPTYK/ember-common-ui/commit/6bb6a222873142584439dcd5aa6e5cebfd2c86e5))
diff --git a/doc-app/README.md b/doc-app/README.md
index 4248b3a4..4bc1caf3 100644
--- a/doc-app/README.md
+++ b/doc-app/README.md
@@ -8,40 +8,39 @@ A short introduction of this app could easily go here.
You will need the following things properly installed on your computer.
- [Git](https://git-scm.com/)
-- [Node.js](https://nodejs.org/) (with npm)
-- [Ember CLI](https://cli.emberjs.com/release/)
+- [Node.js](https://nodejs.org/)
+- [pnpm](https://pnpm.io/)
- [Google Chrome](https://google.com/chrome/)
## Installation
- `git clone ` this repository
- `cd doc-app`
-- `npm install`
+- `pnpm install`
## Running / Development
-- `npm run start`
+- `pnpm start`
- Visit your app at [http://localhost:4200](http://localhost:4200).
- Visit your tests at [http://localhost:4200/tests](http://localhost:4200/tests).
### Code Generators
-Make use of the many generators for code, try `ember help generate` for more details
+Make use of the many generators for code, try `pnpm ember help generate` for more details
### Running Tests
-- `npm run test`
-- `npm run test:ember -- --server`
+- `pnpm test`
### Linting
-- `npm run lint`
-- `npm run lint:fix`
+- `pnpm lint`
+- `pnpm lint:fix`
### Building
-- `npm exec ember build` (development)
-- `npm run build` (production)
+- `pnpm vite build --mode development` (development)
+- `pnpm build` (production)
### Deploying
@@ -50,7 +49,7 @@ Specify what it takes to deploy your app.
## Further Reading / Useful Links
- [ember.js](https://emberjs.com/)
-- [ember-cli](https://cli.emberjs.com/release/)
+- [Vite](https://vite.dev)
- Development Browser Extensions
- [ember inspector for chrome](https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi)
- [ember inspector for firefox](https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/)
diff --git a/doc-app/app/adapters/application.js b/doc-app/app/adapters/application.js
deleted file mode 100644
index 1376f981..00000000
--- a/doc-app/app/adapters/application.js
+++ /dev/null
@@ -1,5 +0,0 @@
-import JSONAPIAdapter from '@ember-data/adapter/json-api';
-
-export default class ApplicationAdapter extends JSONAPIAdapter {
- host = 'http://localhost:4200';
-}
diff --git a/doc-app/app/app.ts b/doc-app/app/app.ts
index 59066108..02589193 100644
--- a/doc-app/app/app.ts
+++ b/doc-app/app/app.ts
@@ -1,12 +1,21 @@
import Application from '@ember/application';
+import compatModules from '@embroider/virtual/compat-modules';
import Resolver from 'ember-resolver';
import loadInitializers from 'ember-load-initializers';
import config from 'doc-app/config/environment';
+import { importSync, isDevelopingApp, macroCondition } from '@embroider/macros';
+import setupInspector from '@embroider/legacy-inspector-support/ember-source-4.12';
+import './styles/app.css';
+
+if (macroCondition(isDevelopingApp())) {
+ importSync('./deprecation-workflow');
+}
export default class App extends Application {
modulePrefix = config.modulePrefix;
podModulePrefix = config.podModulePrefix;
- Resolver = Resolver;
+ Resolver = Resolver.withModules(compatModules);
+ inspector = setupInspector(this);
}
-loadInitializers(App, config.modulePrefix);
+loadInitializers(App, config.modulePrefix, compatModules);
diff --git a/doc-app/app/components/auth-layout.gts b/doc-app/app/components/auth-layout.gts
new file mode 100644
index 00000000..def5731b
--- /dev/null
+++ b/doc-app/app/components/auth-layout.gts
@@ -0,0 +1,16 @@
+import type { TOC } from '@ember/component/template-only';
+
+interface AuthLayoutSignature {
+ Element: HTMLDivElement;
+ Blocks: {
+ default: [];
+ };
+}
+
+
+
+ satisfies TOC;
diff --git a/doc-app/app/components/doc/code-block.gts b/doc-app/app/components/doc/code-block.gts
new file mode 100644
index 00000000..b57a042d
--- /dev/null
+++ b/doc-app/app/components/doc/code-block.gts
@@ -0,0 +1,111 @@
+// doc-app/app/components/doc/code-block.gts
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { action } from '@ember/object';
+import { on } from '@ember/modifier';
+import { codeToHtml } from 'shiki';
+import { htmlSafe } from '@ember/template';
+import type Owner from '@ember/owner';
+
+interface CodeBlockSignature {
+ Args: {
+ code: string;
+ language?: string;
+ };
+}
+
+export default class CodeBlockComponent extends Component {
+ @tracked copied = false;
+ @tracked highlightedHtml = '';
+
+ constructor(owner: Owner, args: CodeBlockSignature['Args']) {
+ super(owner, args);
+ void this.generateHighlightedCode();
+ }
+
+ async generateHighlightedCode() {
+ try {
+ const html = await codeToHtml(this.args.code, {
+ lang: this.language,
+ theme: 'catppuccin-frappe',
+ });
+ this.highlightedHtml = html;
+ } catch (error) {
+ console.error('Failed to highlight code:', error);
+ this.highlightedHtml = `${this.args.code} `;
+ }
+ }
+
+ @action
+ async copyCode() {
+ try {
+ await navigator.clipboard.writeText(this.args.code);
+ this.copied = true;
+ setTimeout(() => {
+ this.copied = false;
+ }, 2000);
+ } catch (err) {
+ console.error('Failed to copy:', err);
+ }
+ }
+
+ get language() {
+ const lang = this.args.language || 'typescript';
+ const languageMap: Record = {
+ ts: 'typescript',
+ gts: 'glimmer-ts',
+ js: 'javascript',
+ };
+ return languageMap[lang] || lang;
+ }
+
+ get safeHtml() {
+ return htmlSafe(this.highlightedHtml);
+ }
+
+
+
+
+
+ {{this.safeHtml}}
+
+
+
+}
diff --git a/doc-app/app/components/doc/code-example.gts b/doc-app/app/components/doc/code-example.gts
new file mode 100644
index 00000000..dad2d883
--- /dev/null
+++ b/doc-app/app/components/doc/code-example.gts
@@ -0,0 +1,108 @@
+// doc-app/app/components/doc/code-example.gts
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { action } from '@ember/object';
+import { service } from '@ember/service';
+import type IntlService from 'ember-intl/services/intl';
+import { on } from '@ember/modifier';
+import { fn } from '@ember/helper';
+
+interface CodeExampleSignature {
+ Args: {
+ title?: string;
+ };
+ Blocks: {
+ default: [];
+ };
+}
+
+export default class CodeExampleComponent extends Component {
+ @service declare intl: IntlService;
+ @tracked activeYield = 'demo';
+
+ @action
+ selectYield(yieldName: string) {
+ this.activeYield = yieldName;
+ }
+
+ get isDemo() {
+ return this.activeYield === 'demo';
+ }
+
+ get isTemplate() {
+ return this.activeYield === 'template';
+ }
+
+ get isJavascript() {
+ return this.activeYield === 'javascript';
+ }
+
+ get isTypescript() {
+ return this.activeYield === 'typescript';
+ }
+
+ getTabClass(isActive: boolean): string {
+ return isActive ? 'tab tab-active' : 'tab';
+ }
+
+
+
+
+
{{@title}}
+
+
+ {{#if (has-block "demo")}}
+ {{! template-lint-disable link-href-attributes }}
+
+ Basic usage
+
+ {{/if}}
+ {{#if (has-block "template")}}
+
+ Template
+
+ {{/if}}
+ {{#if (has-block "javascript")}}
+
+ Javascript
+
+ {{/if}}
+ {{#if (has-block "typescript")}}
+
+ Typescript
+
+ {{/if}}
+
+
+ {{#if this.isDemo}}
+ {{yield to="demo"}}
+ {{/if}}
+ {{#if this.isTemplate}}
+ {{yield to="template"}}
+ {{/if}}
+ {{#if this.isJavascript}}
+ {{yield to="javascript"}}
+ {{/if}}
+ {{#if this.isTypescript}}
+ {{yield to="typescript"}}
+ {{/if}}
+
+
+
+}
diff --git a/doc-app/app/components/doc/page.gts b/doc-app/app/components/doc/page.gts
new file mode 100644
index 00000000..e6f63f23
--- /dev/null
+++ b/doc-app/app/components/doc/page.gts
@@ -0,0 +1,33 @@
+// doc-app/app/components/doc/page.gts
+import Component from '@glimmer/component';
+import { service } from '@ember/service';
+import type IntlService from 'ember-intl/services/intl';
+
+interface DocPageSignature {
+ Args: {
+ title: string;
+ description?: string;
+ };
+ Blocks: {
+ default: [];
+ };
+}
+
+export default class DocPageComponent extends Component {
+ @service declare intl: IntlService;
+
+
+
+
+}
diff --git a/doc-app/app/components/doc/property-table.gts b/doc-app/app/components/doc/property-table.gts
new file mode 100644
index 00000000..8035f1d3
--- /dev/null
+++ b/doc-app/app/components/doc/property-table.gts
@@ -0,0 +1,75 @@
+// doc-app/app/components/doc/property-table.gts
+import type { TOC } from '@ember/component/template-only';
+import t from 'ember-intl/helpers/t';
+
+interface Property {
+ name: string;
+ type: string;
+ required: boolean;
+ description: string;
+}
+
+interface PropertyTableSignature {
+ Args: {
+ properties: Property[];
+ };
+}
+
+const PropertyTable: TOC =
+
+
+
+
+ {{#each @properties as |prop|}}
+
+
+ {{prop.name}}
+
+
+ {{prop.type}}
+
+
+ {{#if prop.required}}
+
+ {{t "docs.propertyTable.yes"}}
+
+ {{else}}
+
+ {{t "docs.propertyTable.no"}}
+
+ {{/if}}
+
+
+ {{t prop.description}}
+
+
+ {{/each}}
+
+
+
+ ;
+
+export default PropertyTable;
diff --git a/doc-app/app/components/doc/section.gts b/doc-app/app/components/doc/section.gts
new file mode 100644
index 00000000..d365d901
--- /dev/null
+++ b/doc-app/app/components/doc/section.gts
@@ -0,0 +1,26 @@
+import { service } from '@ember/service';
+import Component from '@glimmer/component';
+import type { IntlService } from 'ember-intl';
+
+interface DocSectionSignature {
+ Args: {
+ title: string;
+ id?: string;
+ };
+ Blocks: {
+ default: [];
+ };
+}
+
+export default class DocSectionComponent extends Component {
+ @service declare intl: IntlService;
+
+
+
+ {{@title}}
+
+ {{yield}}
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/basic-bic.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/basic-bic.gts
new file mode 100644
index 00000000..fb84c679
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/basic-bic.gts
@@ -0,0 +1,19 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkBicPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-bic';
+
+export default class BasicBicExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ bic: '',
+ });
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/basic-currency.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/basic-currency.gts
new file mode 100644
index 00000000..f40b20bd
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/basic-currency.gts
@@ -0,0 +1,19 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkCurrencyPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-currency';
+
+export default class BasicCurrencyExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ value: '',
+ });
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/basic-datepicker-range.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/basic-datepicker-range.gts
new file mode 100644
index 00000000..20cc826e
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/basic-datepicker-range.gts
@@ -0,0 +1,18 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkDatepickerRangePrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-datepicker-range';
+
+export default class BasicDatepickerRangeExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ range: null,
+ });
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/basic-datepicker.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/basic-datepicker.gts
new file mode 100644
index 00000000..6d12991e
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/basic-datepicker.gts
@@ -0,0 +1,19 @@
+// doc-app/app/components/docs/ember-input-validation/prefabs/basic-datepicker.gts
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkDatepickerPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-datepicker';
+
+export default class BasicDatepickerExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ birthday: null,
+ });
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/basic-email.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/basic-email.gts
new file mode 100644
index 00000000..dd04bd9e
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/basic-email.gts
@@ -0,0 +1,20 @@
+// doc-app/app/components/docs/ember-input-validation/prefabs/basic-email.gts
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkEmailPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-email';
+
+export default class BasicEmailExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ email: '',
+ });
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/basic-file-list.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/basic-file-list.gts
new file mode 100644
index 00000000..fd96ff8e
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/basic-file-list.gts
@@ -0,0 +1,20 @@
+// doc-app/app/components/docs/ember-input-validation/prefabs/basic-file-list.gts
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkFileListPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-file-list';
+
+export default class BasicFileListExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ files: [],
+ });
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/basic-file.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/basic-file.gts
new file mode 100644
index 00000000..6b61e78f
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/basic-file.gts
@@ -0,0 +1,19 @@
+// doc-app/app/components/docs/ember-input-validation/prefabs/basic-file.gts
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkFilePrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-file';
+
+export default class BasicFileExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ file: null,
+ });
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/basic-iban.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/basic-iban.gts
new file mode 100644
index 00000000..668763d1
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/basic-iban.gts
@@ -0,0 +1,20 @@
+// doc-app/app/components/docs/ember-input-validation/prefabs/basic-iban.gts
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkIbanPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-iban';
+
+export default class BasicIbanExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ iban: '',
+ });
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/basic-input.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/basic-input.gts
new file mode 100644
index 00000000..ec45804e
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/basic-input.gts
@@ -0,0 +1,19 @@
+// doc-app/app/components/docs/ember-input-validation/prefabs/basic-input.gts
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkInputPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-input';
+
+export default class BasicInputExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ something: '',
+ });
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/basic-integer.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/basic-integer.gts
new file mode 100644
index 00000000..3ad71a89
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/basic-integer.gts
@@ -0,0 +1,21 @@
+// doc-app/app/components/docs/ember-input-validation/prefabs/basic-integer.gts
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkIntegerPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-integer';
+
+export default class BasicIntegerExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ integer: 0,
+ });
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/basic-mobile.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/basic-mobile.gts
new file mode 100644
index 00000000..ab37dd7e
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/basic-mobile.gts
@@ -0,0 +1,18 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkMobilePrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-mobile';
+
+export default class BasicMobileExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ phone: '',
+ });
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/basic-national-number.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/basic-national-number.gts
new file mode 100644
index 00000000..6fdde5db
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/basic-national-number.gts
@@ -0,0 +1,19 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkNationalNumberPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-national-number';
+
+export default class BasicNationalNumberExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ nationalNumber: '',
+ });
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/basic-number.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/basic-number.gts
new file mode 100644
index 00000000..431cf807
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/basic-number.gts
@@ -0,0 +1,20 @@
+// doc-app/app/components/docs/ember-input-validation/prefabs/basic-number.gts
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkValidationNumber from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-number';
+
+export default class BasicNumberExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ number: 0,
+ });
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/basic-password.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/basic-password.gts
new file mode 100644
index 00000000..4f07cac4
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/basic-password.gts
@@ -0,0 +1,19 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkPasswordPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-password';
+
+export default class BasicPasswordExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ password: '',
+ });
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/basic-radio-group.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/basic-radio-group.gts
new file mode 100644
index 00000000..22a105cb
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/basic-radio-group.gts
@@ -0,0 +1,22 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkRadioGroupPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-radio-group';
+
+export default class BasicRadioGroupExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ radio: '',
+ });
+
+
+
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/basic-radio.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/basic-radio.gts
new file mode 100644
index 00000000..5dcf68e1
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/basic-radio.gts
@@ -0,0 +1,19 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkRadioPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-radio';
+
+export default class BasicRadioExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ radio: '',
+ });
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/basic-select-create.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/basic-select-create.gts
new file mode 100644
index 00000000..a0027f22
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/basic-select-create.gts
@@ -0,0 +1,51 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkSelectCreatePrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-select-create';
+import { action } from '@ember/object';
+
+export default class BasicSelectCreateExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ addon: null,
+ });
+
+ options = [
+ {
+ label: 'ember-power-select',
+ value: 'ember-power-select',
+ toString() {
+ return `${this.label}`;
+ },
+ },
+ {
+ label: 'ember-concurrency',
+ value: 'ember-concurrency',
+ toString() {
+ return `${this.label}`;
+ },
+ },
+ ];
+
+ @action
+ onCreate(selection: unknown) {
+ const value = selection as string;
+ const newOption = {
+ label: value,
+ value: value.toLowerCase().replace(/\s+/g, '-'),
+ toString() {
+ return `${this.label}`;
+ },
+ };
+ this.options = [...this.options, newOption];
+ }
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/basic-select-search.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/basic-select-search.gts
new file mode 100644
index 00000000..9b27a6b0
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/basic-select-search.gts
@@ -0,0 +1,47 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkSelectSearchPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-select-search';
+import { task } from 'ember-concurrency';
+import perform from 'ember-concurrency/helpers/perform';
+
+export default class BasicSelectSearchExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ repository: null,
+ });
+
+ @tracked options: unknown[] = [];
+
+ onSearch = task(async (searchTerm: string) => {
+ // Simulate API call
+ await new Promise((resolve) => setTimeout(resolve, 300));
+
+ const mockRepos = [
+ { label: 'ember-common-ui', value: 'ember-common-ui' },
+ { label: 'ember-power-select', value: 'ember-power-select' },
+ { label: 'ember-concurrency', value: 'ember-concurrency' },
+ { label: 'ember-cli', value: 'ember-cli' },
+ ];
+
+ this.options = mockRepos
+ .filter((repo) =>
+ repo.label.toLowerCase().includes(searchTerm.toLowerCase())
+ )
+ .map((repo) => ({
+ ...repo,
+ toString() {
+ return `${this.label}`;
+ },
+ }));
+ });
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/basic-select.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/basic-select.gts
new file mode 100644
index 00000000..4641aeb1
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/basic-select.gts
@@ -0,0 +1,43 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkSelectPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-select';
+
+export default class BasicSelectExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ addon: null,
+ });
+
+ options = [
+ {
+ label: 'ember-power-select',
+ value: 'ember-power-select',
+ toString() {
+ return `${this.label}`;
+ },
+ },
+ {
+ label: 'ember-concurrency',
+ value: 'ember-concurrency',
+ toString() {
+ return `${this.label}`;
+ },
+ },
+ {
+ label: 'ember-composable-helpers',
+ value: 'ember-composable-helpers',
+ toString() {
+ return `${this.label}`;
+ },
+ },
+ ];
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/basic-textarea.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/basic-textarea.gts
new file mode 100644
index 00000000..dcfba778
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/basic-textarea.gts
@@ -0,0 +1,19 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkTextareaPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-textarea';
+
+export default class BasicTextareaExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ ember: '',
+ });
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/basic-timepicker.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/basic-timepicker.gts
new file mode 100644
index 00000000..7b278020
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/basic-timepicker.gts
@@ -0,0 +1,18 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkTimepickerPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-timepicker';
+
+export default class BasicTimepickerExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ time: null,
+ });
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/basic-vat.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/basic-vat.gts
new file mode 100644
index 00000000..8796b336
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/basic-vat.gts
@@ -0,0 +1,19 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkVatPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-vat';
+
+export default class BasicVatExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ vat: '',
+ });
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-bic.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-bic.gts
new file mode 100644
index 00000000..08f8a712
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-bic.gts
@@ -0,0 +1,19 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkBicPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-bic';
+
+export default class DisabledBicExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ disabled: 'ABNANL2AXXX',
+ });
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-currency.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-currency.gts
new file mode 100644
index 00000000..f80e67c9
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-currency.gts
@@ -0,0 +1,19 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkCurrencyPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-currency';
+
+export default class DisabledCurrencyExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ disabled: '1234.56',
+ });
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-datepicker-range.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-datepicker-range.gts
new file mode 100644
index 00000000..994c7bdb
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-datepicker-range.gts
@@ -0,0 +1,19 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkDatepickerRangePrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-datepicker-range';
+
+export default class DisabledDatepickerRangeExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ disabled: null,
+ });
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-datepicker.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-datepicker.gts
new file mode 100644
index 00000000..f24958a7
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-datepicker.gts
@@ -0,0 +1,20 @@
+// doc-app/app/components/docs/ember-input-validation/prefabs/disabled-datepicker.gts
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkDatepickerPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-datepicker';
+
+export default class DisabledDatepickerExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ disabled: new Date(),
+ });
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-email.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-email.gts
new file mode 100644
index 00000000..c015b9c4
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-email.gts
@@ -0,0 +1,20 @@
+// doc-app/app/components/docs/ember-input-validation/prefabs/disabled-email.gts
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkEmailPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-email';
+
+export default class DisabledEmailExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ disabled: 'disabled@example.com',
+ });
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-file-list.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-file-list.gts
new file mode 100644
index 00000000..f9433064
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-file-list.gts
@@ -0,0 +1,21 @@
+// doc-app/app/components/docs/ember-input-validation/prefabs/disabled-file-list.gts
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkFileListPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-file-list';
+
+export default class DisabledFileListExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ disabled: [],
+ });
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-file.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-file.gts
new file mode 100644
index 00000000..b70d3948
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-file.gts
@@ -0,0 +1,20 @@
+// doc-app/app/components/docs/ember-input-validation/prefabs/disabled-file.gts
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkFilePrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-file';
+
+export default class DisabledFileExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ disabled: null,
+ });
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-iban.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-iban.gts
new file mode 100644
index 00000000..9525b7be
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-iban.gts
@@ -0,0 +1,21 @@
+// doc-app/app/components/docs/ember-input-validation/prefabs/disabled-iban.gts
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkIbanPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-iban';
+
+export default class DisabledIbanExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ disabled: 'BE68 5390 0754 7034',
+ });
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-input.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-input.gts
new file mode 100644
index 00000000..011437f0
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-input.gts
@@ -0,0 +1,25 @@
+// doc-app/app/components/examples/input-validation/disabled-input.gts
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import { object, string } from 'zod';
+import TpkInputPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-input';
+
+export default class DisabledInputExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ disabled: 'This is disabled',
+ });
+
+ validationSchema = object({
+ disabled: string(),
+ });
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-integer.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-integer.gts
new file mode 100644
index 00000000..646a2baa
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-integer.gts
@@ -0,0 +1,21 @@
+// doc-app/app/components/docs/ember-input-validation/prefabs/disabled-integer.gts
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkIntegerPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-integer';
+
+export default class DisabledIntegerExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ disabled: 42,
+ });
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-mobile.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-mobile.gts
new file mode 100644
index 00000000..85da8921
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-mobile.gts
@@ -0,0 +1,19 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkMobilePrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-mobile';
+
+export default class DisabledMobileExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ disabled: '+352 621 123 456',
+ });
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-national-number.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-national-number.gts
new file mode 100644
index 00000000..f5c07dd5
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-national-number.gts
@@ -0,0 +1,20 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkNationalNumberPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-national-number';
+
+export default class DisabledNationalNumberExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ disabled: '12.34.56-789.01',
+ });
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-number.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-number.gts
new file mode 100644
index 00000000..9bfbf260
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-number.gts
@@ -0,0 +1,21 @@
+// doc-app/app/components/docs/ember-input-validation/prefabs/disabled-number.gts
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkValidationNumber from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-number';
+
+export default class DisabledNumberExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ number: 42,
+ });
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-password.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-password.gts
new file mode 100644
index 00000000..b982b511
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-password.gts
@@ -0,0 +1,20 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkPasswordPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-password';
+
+export default class DisabledPasswordExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ disabled: 'DisabledPassword123',
+ });
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-radio-group.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-radio-group.gts
new file mode 100644
index 00000000..2676b01c
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-radio-group.gts
@@ -0,0 +1,23 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkRadioGroupPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-radio-group';
+
+export default class DisabledRadioGroupExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ disabled: 'applati',
+ });
+
+
+
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-radio.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-radio.gts
new file mode 100644
index 00000000..ad4233c9
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-radio.gts
@@ -0,0 +1,20 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkRadioPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-radio';
+
+export default class DisabledRadioExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ disabled: 'selected one',
+ });
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-select-create.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-select-create.gts
new file mode 100644
index 00000000..36b2ccfe
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-select-create.gts
@@ -0,0 +1,58 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkSelectCreatePrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-select-create';
+import { action } from '@ember/object';
+
+export default class DisabledSelectCreateExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ disabled: {
+ label: 'ember-power-select',
+ value: 'ember-power-select',
+ toString() {
+ return `${this.label}`;
+ },
+ },
+ });
+
+ options = [
+ {
+ label: 'ember-power-select',
+ value: 'ember-power-select',
+ toString() {
+ return `${this.label}`;
+ },
+ },
+ {
+ label: 'ember-concurrency',
+ value: 'ember-concurrency',
+ toString() {
+ return `${this.label}`;
+ },
+ },
+ ];
+
+ @action
+ onCreate(selection: unknown) {
+ const value = selection as string;
+ const newOption = {
+ label: value,
+ value: value.toLowerCase().replace(/\s+/g, '-'),
+ toString() {
+ return `${this.label}`;
+ },
+ };
+ this.options = [...this.options, newOption];
+ }
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-select-search.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-select-search.gts
new file mode 100644
index 00000000..745c5442
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-select-search.gts
@@ -0,0 +1,51 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkSelectSearchPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-select-search';
+import { task } from 'ember-concurrency';
+import perform from 'ember-concurrency/helpers/perform';
+
+export default class DisabledSelectSearchExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ disabled: {
+ label: 'ember-common-ui',
+ value: 'ember-common-ui',
+ toString() {
+ return `${this.label}`;
+ },
+ },
+ });
+
+ @tracked options: unknown[] = [];
+
+ onSearch = task(async (searchTerm: string) => {
+ await new Promise((resolve) => setTimeout(resolve, 300));
+
+ const mockRepos = [
+ { label: 'ember-common-ui', value: 'ember-common-ui' },
+ { label: 'ember-power-select', value: 'ember-power-select' },
+ ];
+
+ this.options = mockRepos
+ .filter((repo) =>
+ repo.label.toLowerCase().includes(searchTerm.toLowerCase())
+ )
+ .map((repo) => ({
+ ...repo,
+ toString() {
+ return `${this.label}`;
+ },
+ }));
+ });
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-select.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-select.gts
new file mode 100644
index 00000000..6a55d085
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-select.gts
@@ -0,0 +1,43 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkSelectPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-select';
+
+export default class DisabledSelectExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ disabled: {
+ label: 'ember-power-select',
+ value: 'ember-power-select',
+ toString() {
+ return `${this.label}`;
+ },
+ },
+ });
+
+ options = [
+ {
+ label: 'ember-power-select',
+ value: 'ember-power-select',
+ toString() {
+ return `${this.label}`;
+ },
+ },
+ {
+ label: 'ember-concurrency',
+ value: 'ember-concurrency',
+ toString() {
+ return `${this.label}`;
+ },
+ },
+ ];
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-textarea.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-textarea.gts
new file mode 100644
index 00000000..d3e00d8b
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-textarea.gts
@@ -0,0 +1,19 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkTextareaPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-textarea';
+
+export default class DisabledTextareaExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ disabled: 'This textarea is disabled',
+ });
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-timepicker.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-timepicker.gts
new file mode 100644
index 00000000..11e71bd7
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-timepicker.gts
@@ -0,0 +1,19 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkTimepickerPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-timepicker';
+
+export default class DisabledTimepickerExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ disabled: '14:30',
+ });
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-vat.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-vat.gts
new file mode 100644
index 00000000..4871949c
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/disabled-vat.gts
@@ -0,0 +1,20 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkVatPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-vat';
+
+export default class DisabledVatExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ disabled: 'BE0123456789',
+ });
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/error-bic.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/error-bic.gts
new file mode 100644
index 00000000..ce9e09f7
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/error-bic.gts
@@ -0,0 +1,56 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkBicPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-bic';
+import type Owner from '@ember/owner';
+import { action } from '@ember/object';
+
+export default class ErrorBicExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ bic: '',
+ });
+
+ @action
+ onChange(value: string | number | Date | null) {
+ if (typeof value !== 'string') {
+ this.changeset.addError({
+ message: 'should be a string value',
+ value: 'err',
+ originalValue: '',
+ key: 'bic',
+ });
+ }
+ if ((value as string).length >= 8) {
+ this.changeset.removeErrors();
+ } else {
+ this.changeset.addError({
+ message: 'BIC must be at least 8 characters',
+ value: 'err',
+ originalValue: '',
+ key: 'bic',
+ });
+ }
+ }
+
+ constructor(owner: Owner, args: never) {
+ super(owner, args);
+ setTimeout(() => {
+ this.changeset.addError({
+ message: 'BIC must be at least 8 characters',
+ value: 'err',
+ originalValue: '',
+ key: 'bic',
+ });
+ }, 0);
+ }
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/error-currency.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/error-currency.gts
new file mode 100644
index 00000000..76412b40
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/error-currency.gts
@@ -0,0 +1,56 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkCurrencyPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-currency';
+import type Owner from '@ember/owner';
+import { action } from '@ember/object';
+
+export default class ErrorCurrencyExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ error: '',
+ });
+
+ @action
+ onChange(value: string | number | Date | null) {
+ if (typeof value !== 'number') {
+ this.changeset.addError({
+ message: 'should be a number value',
+ value: 'err',
+ originalValue: 0,
+ key: 'number',
+ });
+ return;
+ }
+ if (value !== null && value > 0) {
+ this.changeset.removeErrors();
+ } else {
+ this.changeset.addError({
+ message: 'Amount must be greater than 0',
+ value: 'err',
+ originalValue: '',
+ key: 'error',
+ });
+ }
+ }
+
+ constructor(owner: Owner, args: never) {
+ super(owner, args);
+ setTimeout(() => {
+ this.changeset.addError({
+ message: 'Amount must be greater than 0',
+ value: 'err',
+ originalValue: '',
+ key: 'error',
+ });
+ }, 0);
+ }
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/error-datepicker-range.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/error-datepicker-range.gts
new file mode 100644
index 00000000..05b55e08
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/error-datepicker-range.gts
@@ -0,0 +1,65 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkDatepickerRangePrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-datepicker-range';
+import type Owner from '@ember/owner';
+import { action } from '@ember/object';
+
+export default class ErrorDatepickerRangeExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ error: null,
+ });
+
+ @action
+ onChange(value: Date[] | null) {
+ if (value && value.length === 2) {
+ const [startDate, endDate] = value;
+ if (!endDate || !startDate) {
+ this.changeset.addError({
+ message: 'need a start and end date',
+ value: 'err',
+ originalValue: null,
+ key: 'error',
+ });
+ return;
+ }
+
+ const daysDiff = Math.floor(
+ (endDate.getTime() - startDate.getTime()) / (1000 * 60 * 60 * 24)
+ );
+ if (daysDiff > 30) {
+ this.changeset.addError({
+ message: 'Date range cannot exceed 30 days',
+ value: 'err',
+ originalValue: null,
+ key: 'error',
+ });
+ } else {
+ this.changeset.removeErrors();
+ }
+ } else {
+ this.changeset.removeErrors();
+ }
+ }
+
+ constructor(owner: Owner, args: never) {
+ super(owner, args);
+ setTimeout(() => {
+ this.changeset.addError({
+ message: 'Please select a valid date range',
+ value: 'err',
+ originalValue: null,
+ key: 'error',
+ });
+ }, 0);
+ }
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/error-datepicker.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/error-datepicker.gts
new file mode 100644
index 00000000..4cfd2019
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/error-datepicker.gts
@@ -0,0 +1,58 @@
+// doc-app/app/components/docs/ember-input-validation/prefabs/error-datepicker.gts
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkDatepickerPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-datepicker';
+import type Owner from '@ember/owner';
+import { action } from '@ember/object';
+
+export default class ErrorDatepickerExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ birthday: null,
+ });
+
+ @action
+ onChange(value: Date[]) {
+ if (!Array.isArray(value) || value.length === 0) {
+ this.changeset.addError({
+ message: 'need a start and end date',
+ value: 'err',
+ originalValue: null,
+ key: 'error',
+ });
+ return;
+ }
+ const dateValue = value[0];
+ if (dateValue && dateValue > new Date()) {
+ this.changeset.addError({
+ message: 'Date must be in the past',
+ value: 'err',
+ originalValue: null,
+ key: 'birthday',
+ });
+ } else if (dateValue) {
+ this.changeset.removeErrors();
+ }
+ }
+
+ constructor(owner: Owner, args: never) {
+ super(owner, args);
+ setTimeout(() => {
+ this.changeset.addError({
+ message: 'Please select a date',
+ value: 'err',
+ originalValue: null,
+ key: 'birthday',
+ });
+ }, 0);
+ }
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/error-email.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/error-email.gts
new file mode 100644
index 00000000..013b09e1
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/error-email.gts
@@ -0,0 +1,69 @@
+// doc-app/app/components/docs/ember-input-validation/prefabs/error-email.gts
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkEmailPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-email';
+import type Owner from '@ember/owner';
+import { action } from '@ember/object';
+
+export default class ErrorEmailExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ email: '',
+ });
+
+ @action
+ onChange(value: string | number | Date | null) {
+ // Email validation logic
+ const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
+
+ if (typeof value !== 'string') {
+ this.changeset.addError({
+ message: 'Email should be a string value',
+ value: 'err',
+ originalValue: '',
+ key: 'email',
+ });
+ return;
+ }
+
+ if (!value || value.trim() === '') {
+ this.changeset.addError({
+ message: 'Email is required',
+ value: 'err',
+ originalValue: '',
+ key: 'email',
+ });
+ } else if (!emailRegex.test(value)) {
+ this.changeset.addError({
+ message: 'Please enter a valid email address',
+ value: 'err',
+ originalValue: '',
+ key: 'email',
+ });
+ } else {
+ this.changeset.removeErrors();
+ }
+ }
+
+ constructor(owner: Owner, args: never) {
+ super(owner, args);
+ setTimeout(() => {
+ this.changeset.addError({
+ message: 'Email is required',
+ value: 'err',
+ originalValue: '',
+ key: 'email',
+ });
+ }, 0);
+ }
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/error-file-list.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/error-file-list.gts
new file mode 100644
index 00000000..843e6d8c
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/error-file-list.gts
@@ -0,0 +1,61 @@
+// doc-app/app/components/docs/ember-input-validation/prefabs/error-file-list.gts
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkFileListPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-file-list';
+import type Owner from '@ember/owner';
+import { action } from '@ember/object';
+
+export default class ErrorFileListExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ files: [],
+ });
+
+ @action
+ onChange(value: unknown) {
+ // File validation logic
+ if (!Array.isArray(value)) {
+ this.changeset.addError({
+ message: 'Value should be an array',
+ value: 'err',
+ originalValue: [],
+ key: 'files',
+ });
+ return;
+ }
+
+ if (value.length === 0) {
+ this.changeset.addError({
+ message: 'At least one file is required',
+ value: 'err',
+ originalValue: [],
+ key: 'files',
+ });
+ } else {
+ this.changeset.removeErrors();
+ }
+ }
+
+ constructor(owner: Owner, args: never) {
+ super(owner, args);
+ setTimeout(() => {
+ this.changeset.addError({
+ message: 'At least one file is required',
+ value: 'err',
+ originalValue: [],
+ key: 'files',
+ });
+ }, 0);
+ }
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/error-file.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/error-file.gts
new file mode 100644
index 00000000..42c9ff8e
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/error-file.gts
@@ -0,0 +1,50 @@
+// doc-app/app/components/docs/ember-input-validation/prefabs/error-file.gts
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkFilePrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-file';
+import type Owner from '@ember/owner';
+import { action } from '@ember/object';
+
+export default class ErrorFileExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ file: null,
+ });
+
+ @action
+ onChange(value: unknown) {
+ // File validation logic
+ if (!value) {
+ this.changeset.addError({
+ message: 'File is required',
+ value: 'err',
+ originalValue: null,
+ key: 'file',
+ });
+ } else {
+ this.changeset.removeErrors();
+ }
+ }
+
+ constructor(owner: Owner, args: never) {
+ super(owner, args);
+ setTimeout(() => {
+ this.changeset.addError({
+ message: 'File is required',
+ value: 'err',
+ originalValue: null,
+ key: 'file',
+ });
+ }, 0);
+ }
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/error-iban.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/error-iban.gts
new file mode 100644
index 00000000..9ed6c266
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/error-iban.gts
@@ -0,0 +1,69 @@
+// doc-app/app/components/docs/ember-input-validation/prefabs/error-iban.gts
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkIbanPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-iban';
+import type Owner from '@ember/owner';
+import { action } from '@ember/object';
+
+export default class ErrorIbanExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ iban: '',
+ });
+
+ @action
+ onChange(value: string | number | Date | null) {
+ // IBAN validation logic
+ if (typeof value !== 'string') {
+ this.changeset.addError({
+ message: 'IBAN should be a string value',
+ value: 'err',
+ originalValue: '',
+ key: 'iban',
+ });
+ return;
+ }
+
+ const ibanWithoutSpaces = value.replace(/\s/g, '');
+
+ if (!ibanWithoutSpaces) {
+ this.changeset.addError({
+ message: 'IBAN is required',
+ value: 'err',
+ originalValue: '',
+ key: 'iban',
+ });
+ } else if (ibanWithoutSpaces.length < 15) {
+ this.changeset.addError({
+ message: 'IBAN must be at least 15 characters',
+ value: 'err',
+ originalValue: '',
+ key: 'iban',
+ });
+ } else {
+ this.changeset.removeErrors();
+ }
+ }
+
+ constructor(owner: Owner, args: never) {
+ super(owner, args);
+ setTimeout(() => {
+ this.changeset.addError({
+ message: 'IBAN is required',
+ value: 'err',
+ originalValue: '',
+ key: 'iban',
+ });
+ }, 0);
+ }
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/error-input.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/error-input.gts
new file mode 100644
index 00000000..ec410126
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/error-input.gts
@@ -0,0 +1,58 @@
+// doc-app/app/components/examples/input-validation/error-input.gts
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkInputPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-input';
+import type Owner from '@ember/owner';
+import { action } from '@ember/object';
+
+export default class ErrorInputExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ something: '',
+ });
+
+ @action
+ onChange(value: string | number | Date | null) {
+ // Type guard to ensure we only work with strings
+ if (typeof value !== 'string') {
+ this.changeset.addError({
+ message: 'should be a string value',
+ value: 'err',
+ originalValue: '',
+ key: 'something',
+ });
+ }
+
+ if ((value as string)?.length >= 5) {
+ this.changeset.removeErrors();
+ } else {
+ this.changeset.addError({
+ message: 'Minimum 5 characters',
+ value: 'err',
+ originalValue: '',
+ key: 'something',
+ });
+ }
+ }
+
+ constructor(owner: Owner, args: never) {
+ super(owner, args);
+ setTimeout(() => {
+ this.changeset.addError({
+ message: 'Minimum 5 characters',
+ value: 'err',
+ originalValue: '',
+ key: 'something',
+ });
+ }, 0);
+ }
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/error-integer.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/error-integer.gts
new file mode 100644
index 00000000..eab5e059
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/error-integer.gts
@@ -0,0 +1,71 @@
+// doc-app/app/components/docs/ember-input-validation/prefabs/error-integer.gts
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkIntegerPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-integer';
+import type Owner from '@ember/owner';
+import { action } from '@ember/object';
+
+export default class ErrorIntegerExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ integer: null,
+ });
+
+ @action
+ onChange(value: string | number | Date | null) {
+ // Integer validation logic
+ if (value === null || value === undefined || value === '') {
+ this.changeset.addError({
+ message: 'Integer is required',
+ value: 'err',
+ originalValue: null,
+ key: 'integer',
+ });
+ return;
+ }
+
+ const numValue =
+ typeof value === 'number' ? value : parseFloat(value as string);
+
+ if (isNaN(numValue)) {
+ this.changeset.addError({
+ message: 'Must be a valid number',
+ value: 'err',
+ originalValue: null,
+ key: 'integer',
+ });
+ } else if (!Number.isInteger(numValue)) {
+ this.changeset.addError({
+ message: 'Must be an integer (no decimal)',
+ value: 'err',
+ originalValue: null,
+ key: 'integer',
+ });
+ } else {
+ this.changeset.removeErrors();
+ }
+ }
+
+ constructor(owner: Owner, args: never) {
+ super(owner, args);
+ setTimeout(() => {
+ this.changeset.addError({
+ message: 'Integer is required',
+ value: 'err',
+ originalValue: null,
+ key: 'integer',
+ });
+ }, 0);
+ }
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/error-mobile.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/error-mobile.gts
new file mode 100644
index 00000000..4e61001b
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/error-mobile.gts
@@ -0,0 +1,56 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkMobilePrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-mobile';
+import type Owner from '@ember/owner';
+import { action } from '@ember/object';
+
+export default class ErrorMobileExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ phone: '',
+ });
+
+ @action
+ onChange(value: string | number | Date | null) {
+ if (typeof value !== 'number') {
+ this.changeset.addError({
+ message: 'should be a string value',
+ value: 'err',
+ originalValue: '',
+ key: 'phone',
+ });
+ }
+ if ((value as string)?.length >= 10) {
+ this.changeset.removeErrors();
+ } else {
+ this.changeset.addError({
+ message: 'Minimum 10 characters',
+ value: 'err',
+ originalValue: '',
+ key: 'phone',
+ });
+ }
+ }
+
+ constructor(owner: Owner, args: never) {
+ super(owner, args);
+ setTimeout(() => {
+ this.changeset.addError({
+ message: 'Minimum 10 characters',
+ value: 'err',
+ originalValue: '',
+ key: 'phone',
+ });
+ }, 0);
+ }
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/error-national-number.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/error-national-number.gts
new file mode 100644
index 00000000..f3ed820a
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/error-national-number.gts
@@ -0,0 +1,56 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkNationalNumberPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-national-number';
+import type Owner from '@ember/owner';
+import { action } from '@ember/object';
+
+export default class ErrorNationalNumberExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ nationalNumber: '',
+ });
+
+ @action
+ onChange(value: string | number | Date | null) {
+ if (typeof value !== 'string') {
+ this.changeset.addError({
+ message: 'should be a string value',
+ value: 'err',
+ originalValue: '',
+ key: 'nationalNumber',
+ });
+ }
+ if ((value as string)?.length >= 11) {
+ this.changeset.removeErrors();
+ } else {
+ this.changeset.addError({
+ message: 'Invalid national number format',
+ value: 'err',
+ originalValue: '',
+ key: 'nationalNumber',
+ });
+ }
+ }
+
+ constructor(owner: Owner, args: never) {
+ super(owner, args);
+ setTimeout(() => {
+ this.changeset.addError({
+ message: 'Invalid national number format',
+ value: 'err',
+ originalValue: '',
+ key: 'nationalNumber',
+ });
+ }, 0);
+ }
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/error-number.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/error-number.gts
new file mode 100644
index 00000000..0705fd6d
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/error-number.gts
@@ -0,0 +1,59 @@
+// doc-app/app/components/docs/ember-input-validation/prefabs/error-number.gts
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkValidationNumber from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-number';
+import type Owner from '@ember/owner';
+import { action } from '@ember/object';
+
+export default class ErrorNumberExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ number: 0,
+ });
+
+ @action
+ onChange(value: string | number | Date | null) {
+ if (typeof value !== 'number') {
+ this.changeset.addError({
+ message: 'should be a number value',
+ value: 'err',
+ originalValue: 0,
+ key: 'number',
+ });
+ return;
+ }
+
+ if (value >= 10) {
+ this.changeset.removeErrors();
+ } else {
+ this.changeset.addError({
+ message: 'Minimum value is 10',
+ value: 'err',
+ originalValue: 0,
+ key: 'number',
+ });
+ }
+ }
+
+ constructor(owner: Owner, args: never) {
+ super(owner, args);
+ setTimeout(() => {
+ this.changeset.addError({
+ message: 'Minimum value is 10',
+ value: 'err',
+ originalValue: 0,
+ key: 'number',
+ });
+ }, 0);
+ }
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/error-password.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/error-password.gts
new file mode 100644
index 00000000..03bf0e4d
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/error-password.gts
@@ -0,0 +1,56 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkPasswordPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-password';
+import type Owner from '@ember/owner';
+import { action } from '@ember/object';
+
+export default class ErrorPasswordExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ password: '',
+ });
+
+ @action
+ onChange(value: string | number | Date | null) {
+ if (typeof value !== 'string') {
+ this.changeset.addError({
+ message: 'should be a string value',
+ value: 'err',
+ originalValue: '',
+ key: 'password',
+ });
+ }
+ if ((value as string)?.length >= 8) {
+ this.changeset.removeErrors();
+ } else {
+ this.changeset.addError({
+ message: 'Minimum 8 characters',
+ value: 'err',
+ originalValue: '',
+ key: 'password',
+ });
+ }
+ }
+
+ constructor(owner: Owner, args: never) {
+ super(owner, args);
+ setTimeout(() => {
+ this.changeset.addError({
+ message: 'Minimum 8 characters',
+ value: 'err',
+ originalValue: '',
+ key: 'password',
+ });
+ }, 0);
+ }
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/error-radio-group.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/error-radio-group.gts
new file mode 100644
index 00000000..7e44e020
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/error-radio-group.gts
@@ -0,0 +1,51 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkRadioGroupPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-radio-group';
+import type Owner from '@ember/owner';
+import { action } from '@ember/object';
+
+export default class ErrorRadioGroupExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ radio: '',
+ });
+
+ @action
+ onChange(value: string | number | Date | null) {
+ if (!value) {
+ this.changeset.addError({
+ message: 'should be a string value',
+ value: 'err',
+ originalValue: '',
+ key: 'radio',
+ });
+ } else {
+ this.changeset.removeErrors();
+ }
+ }
+
+ constructor(owner: Owner, args: never) {
+ super(owner, args);
+ setTimeout(() => {
+ this.changeset.addError({
+ message: 'A selection is mandatory',
+ value: 'err',
+ originalValue: '',
+ key: 'radio',
+ });
+ }, 0);
+ }
+
+
+
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/error-radio.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/error-radio.gts
new file mode 100644
index 00000000..2734ea9b
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/error-radio.gts
@@ -0,0 +1,48 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkRadioPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-radio';
+import type Owner from '@ember/owner';
+import { action } from '@ember/object';
+
+export default class ErrorRadioExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ radio: '',
+ });
+
+ @action
+ onChange(value: string | number | Date | null) {
+ if (!value) {
+ this.changeset.addError({
+ message: 'Please select an option',
+ value: 'err',
+ originalValue: '',
+ key: 'radio',
+ });
+ } else {
+ this.changeset.removeErrors();
+ }
+ }
+
+ constructor(owner: Owner, args: never) {
+ super(owner, args);
+ setTimeout(() => {
+ this.changeset.addError({
+ message: 'Please select an option',
+ value: 'err',
+ originalValue: '',
+ key: 'radio',
+ });
+ }, 0);
+ }
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/error-select-create.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/error-select-create.gts
new file mode 100644
index 00000000..68514d6e
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/error-select-create.gts
@@ -0,0 +1,79 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkSelectCreatePrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-select-create';
+import type Owner from '@ember/owner';
+import { action } from '@ember/object';
+
+export default class ErrorSelectCreateExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ addon: null,
+ });
+
+ options = [
+ {
+ label: 'ember-power-select',
+ value: 'ember-power-select',
+ toString() {
+ return `${this.label}`;
+ },
+ },
+ {
+ label: 'ember-concurrency',
+ value: 'ember-concurrency',
+ toString() {
+ return `${this.label}`;
+ },
+ },
+ ];
+
+ @action
+ onCreate(selection: unknown) {
+ const value = selection as string;
+ const newOption = {
+ label: value,
+ value: value.toLowerCase().replace(/\s+/g, '-'),
+ toString() {
+ return `${this.label}`;
+ },
+ };
+ this.options = [...this.options, newOption];
+ }
+
+ @action
+ onChange(value: unknown) {
+ if (!value) {
+ this.changeset.addError({
+ message: 'Please select or create an addon',
+ value: 'err',
+ originalValue: '',
+ key: 'addon',
+ });
+ } else {
+ this.changeset.removeErrors();
+ }
+ }
+
+ constructor(owner: Owner, args: never) {
+ super(owner, args);
+ setTimeout(() => {
+ this.changeset.addError({
+ message: 'Please select or create an addon',
+ value: 'err',
+ originalValue: '',
+ key: 'addon',
+ });
+ }, 0);
+ }
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/error-select-search.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/error-select-search.gts
new file mode 100644
index 00000000..fc4ce01d
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/error-select-search.gts
@@ -0,0 +1,74 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkSelectSearchPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-select-search';
+import type Owner from '@ember/owner';
+import { action } from '@ember/object';
+import { task } from 'ember-concurrency';
+import perform from 'ember-concurrency/helpers/perform';
+
+export default class ErrorSelectSearchExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ repository: null,
+ });
+
+ @tracked options: unknown[] = [];
+
+ onSearch = task(async (searchTerm: string) => {
+ await new Promise((resolve) => setTimeout(resolve, 300));
+
+ const mockRepos = [
+ { label: 'ember-common-ui', value: 'ember-common-ui' },
+ { label: 'ember-power-select', value: 'ember-power-select' },
+ { label: 'ember-concurrency', value: 'ember-concurrency' },
+ ];
+
+ this.options = mockRepos
+ .filter((repo) =>
+ repo.label.toLowerCase().includes(searchTerm.toLowerCase())
+ )
+ .map((repo) => ({
+ ...repo,
+ toString() {
+ return `${this.label}`;
+ },
+ }));
+ });
+
+ @action
+ onChange(value: unknown) {
+ if (!value) {
+ this.changeset.addError({
+ message: 'Please select a repository',
+ value: 'err',
+ originalValue: '',
+ key: 'repository',
+ });
+ } else {
+ this.changeset.removeErrors();
+ }
+ }
+
+ constructor(owner: Owner, args: never) {
+ super(owner, args);
+ setTimeout(() => {
+ this.changeset.addError({
+ message: 'Please select a repository',
+ value: 'err',
+ originalValue: '',
+ key: 'repository',
+ });
+ }, 0);
+ }
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/error-select.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/error-select.gts
new file mode 100644
index 00000000..de5d71b7
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/error-select.gts
@@ -0,0 +1,72 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkSelectPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-select';
+import type Owner from '@ember/owner';
+import { action } from '@ember/object';
+
+export default class ErrorSelectExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ addon: null,
+ });
+
+ options = [
+ {
+ label: 'ember-power-select',
+ value: 'ember-power-select',
+ toString() {
+ return `${this.label}`;
+ },
+ },
+ {
+ label: 'ember-concurrency',
+ value: 'ember-concurrency',
+ toString() {
+ return `${this.label}`;
+ },
+ },
+ {
+ label: 'ember-composable-helpers',
+ value: 'ember-composable-helpers',
+ toString() {
+ return `${this.label}`;
+ },
+ },
+ ];
+
+ @action
+ onChange(value: unknown) {
+ if (!value) {
+ this.changeset.addError({
+ message: 'Please select an addon',
+ value: 'err',
+ originalValue: '',
+ key: 'addon',
+ });
+ } else {
+ this.changeset.removeErrors();
+ }
+ }
+
+ constructor(owner: Owner, args: never) {
+ super(owner, args);
+ setTimeout(() => {
+ this.changeset.addError({
+ message: 'Please select an addon',
+ value: 'err',
+ originalValue: '',
+ key: 'addon',
+ });
+ }, 0);
+ }
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/error-textarea.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/error-textarea.gts
new file mode 100644
index 00000000..51cd946e
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/error-textarea.gts
@@ -0,0 +1,48 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkTextareaPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-textarea';
+import type Owner from '@ember/owner';
+import { action } from '@ember/object';
+
+export default class ErrorTextareaExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ ember: '',
+ });
+
+ @action
+ onChange(value: string) {
+ if (!value || value.length < 10) {
+ this.changeset.addError({
+ message: 'Minimum 10 characters',
+ value: 'err',
+ originalValue: '',
+ key: 'ember',
+ });
+ } else {
+ this.changeset.removeErrors();
+ }
+ }
+
+ constructor(owner: Owner, args: never) {
+ super(owner, args);
+ setTimeout(() => {
+ this.changeset.addError({
+ message: 'Minimum 10 characters',
+ value: 'err',
+ originalValue: '',
+ key: 'ember',
+ });
+ }, 0);
+ }
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/error-timepicker.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/error-timepicker.gts
new file mode 100644
index 00000000..f671ef9a
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/error-timepicker.gts
@@ -0,0 +1,47 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkTimepickerPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-timepicker';
+import type Owner from '@ember/owner';
+import { action } from '@ember/object';
+
+export default class ErrorTimepickerExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ time: null,
+ });
+
+ @action
+ onChange(value: Date[]) {
+ if (!value) {
+ this.changeset.addError({
+ message: 'Please select a time',
+ value: 'err',
+ originalValue: '',
+ key: 'time',
+ });
+ } else {
+ this.changeset.removeErrors();
+ }
+ }
+
+ constructor(owner: Owner, args: never) {
+ super(owner, args);
+ setTimeout(() => {
+ this.changeset.addError({
+ message: 'Please select a time',
+ value: 'err',
+ originalValue: '',
+ key: 'time',
+ });
+ }, 0);
+ }
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/error-vat.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/error-vat.gts
new file mode 100644
index 00000000..ee544763
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/error-vat.gts
@@ -0,0 +1,56 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkVatPrefab from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-vat';
+import type Owner from '@ember/owner';
+import { action } from '@ember/object';
+
+export default class ErrorVatExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ vat: '',
+ });
+
+ @action
+ onChange(value: string | number | Date | null) {
+ if (typeof value !== 'string') {
+ this.changeset.addError({
+ message: 'should be a string value',
+ value: 'err',
+ originalValue: '',
+ key: 'password',
+ });
+ }
+ if (!value || (value as string).length < 5) {
+ this.changeset.addError({
+ message: 'Please enter a valid VAT number',
+ value: 'err',
+ originalValue: '',
+ key: 'vat',
+ });
+ } else {
+ this.changeset.removeErrors();
+ }
+ }
+
+ constructor(owner: Owner, args: never) {
+ super(owner, args);
+ setTimeout(() => {
+ this.changeset.addError({
+ message: 'Please enter a valid VAT number',
+ value: 'err',
+ originalValue: '',
+ key: 'vat',
+ });
+ }, 0);
+ }
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input-validation/prefabs/unsigned-number.gts b/doc-app/app/components/docs/ember-input-validation/prefabs/unsigned-number.gts
new file mode 100644
index 00000000..7432d08e
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input-validation/prefabs/unsigned-number.gts
@@ -0,0 +1,21 @@
+// doc-app/app/components/docs/ember-input-validation/prefabs/unsigned-number.gts
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import TpkValidationNumber from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-number';
+
+export default class UnsignedNumberExample extends Component {
+ @tracked changeset = new ImmerChangeset({
+ uNumber: 0,
+ });
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input/prefabs/button.gts b/doc-app/app/components/docs/ember-input/prefabs/button.gts
new file mode 100644
index 00000000..a6a9adae
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input/prefabs/button.gts
@@ -0,0 +1,25 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { action } from '@ember/object';
+import TpkPrefabButton from '@triptyk/ember-input/components/prefabs/tpk-prefab-button';
+
+export default class ButtonExample extends Component {
+ @tracked counter = 0;
+
+ @action
+ incrementCounter() {
+ this.counter++;
+ }
+
+
+
+
+
+
+
count = {{this.counter}}
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input/prefabs/disabled-button.gts b/doc-app/app/components/docs/ember-input/prefabs/disabled-button.gts
new file mode 100644
index 00000000..39aa1abf
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input/prefabs/disabled-button.gts
@@ -0,0 +1,23 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { action } from '@ember/object';
+import TpkPrefabButton from '@triptyk/ember-input/components/prefabs/tpk-prefab-button';
+
+export default class DisabledButtonExample extends Component {
+ @tracked counter = 0;
+
+ @action
+ incrementCounter() {
+ this.counter++;
+ }
+
+
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input/prefabs/disabled-toggle.gts b/doc-app/app/components/docs/ember-input/prefabs/disabled-toggle.gts
new file mode 100644
index 00000000..6f4ded71
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input/prefabs/disabled-toggle.gts
@@ -0,0 +1,13 @@
+import Component from '@glimmer/component';
+import TpkTogglePrefabComponent from '@triptyk/ember-input/components/prefabs/tpk-toggle';
+
+// eslint-disable-next-line ember/no-empty-glimmer-component-classes
+export default class DisabledToggleExample extends Component {
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-input/prefabs/toggle.gts b/doc-app/app/components/docs/ember-input/prefabs/toggle.gts
new file mode 100644
index 00000000..ea2e9a3f
--- /dev/null
+++ b/doc-app/app/components/docs/ember-input/prefabs/toggle.gts
@@ -0,0 +1,9 @@
+import Component from '@glimmer/component';
+import TpkTogglePrefab from '@triptyk/ember-input/components/prefabs/tpk-toggle';
+
+// eslint-disable-next-line ember/no-empty-glimmer-component-classes
+export default class ToggleExample extends Component {
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-ui/prefabs/confirm-modal.gts b/doc-app/app/components/docs/ember-ui/prefabs/confirm-modal.gts
new file mode 100644
index 00000000..45ac3da0
--- /dev/null
+++ b/doc-app/app/components/docs/ember-ui/prefabs/confirm-modal.gts
@@ -0,0 +1,39 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import TpkConfirmModalPrefab from '@triptyk/ember-ui/components/prefabs/tpk-confirm-modal-prefab';
+import { action } from '@ember/object';
+import TpkButtonPrefabComponent from '@triptyk/ember-input/components/prefabs/tpk-prefab-button';
+
+export default class ConfirmModalExample extends Component {
+ @tracked isOpen = false;
+ confirmQuestion = 'Are you sure?';
+
+ @action
+ open() {
+ this.isOpen = true;
+ }
+
+ @action
+ onClose() {
+ this.isOpen = false;
+ }
+
+ @action
+ onConfirm() {
+ this.isOpen = false;
+ alert('Confirmed');
+ }
+
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-ui/prefabs/table-generic.gts b/doc-app/app/components/docs/ember-ui/prefabs/table-generic.gts
new file mode 100644
index 00000000..ec2f43b5
--- /dev/null
+++ b/doc-app/app/components/docs/ember-ui/prefabs/table-generic.gts
@@ -0,0 +1,97 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { action } from '@ember/object';
+import TpkTableGenericPrefab from '@triptyk/ember-ui/components/prefabs/tpk-table-generic-prefab';
+import type { TableParams } from '@triptyk/ember-ui/components/prefabs/tpk-table-generic-prefab';
+import TpkSelect from '@triptyk/ember-input/components/tpk-select';
+import type { TOC } from '@ember/component/template-only';
+import type { TpkSelectSignature } from '@triptyk/ember-input/components/tpk-select';
+import { hash } from '@ember/helper';
+import stringify from 'doc-app/helpers/to-string';
+
+const TpkSelectElement: TOC<
+ TpkSelectSignature & {
+ Args: {
+ cellValue: string;
+ };
+ }
+> =
+
+
+
+ {{stringify O.option}}
+
+
+
+ ;
+
+export default class TpkTableGenericPrefabExample extends Component {
+ @tracked tableParams: TableParams = {
+ entity: 'user',
+ pageSizes: [10, 30, 50, 75],
+ defaultSortColumn: 'firstName',
+ columns: [
+ {
+ field: 'lastName',
+ headerName: 'Nom',
+ sortable: true,
+ },
+ {
+ field: 'firstName',
+ headerName: 'Prénom',
+ sortable: true,
+ },
+ {
+ field: 'email',
+ headerName: 'Email',
+ sortable: false,
+ component: 'selectEmail',
+ },
+ ],
+ actionMenu: [
+ {
+ icon: 'edit',
+ action: (element: unknown) => {
+ console.log('Edit clicked', element);
+ },
+ name: 'Edit',
+ },
+ {
+ icon: 'delete',
+ action: (element: unknown) => {
+ console.log('Delete clicked', element);
+ },
+ name: 'Delete',
+ },
+ ],
+ };
+
+ emailOptions = ['info@triptyk.eu', 'loempia@triptyk.eu'];
+
+ @action
+ onEmailChange(selection: unknown) {
+ console.log('Email changed:', selection);
+ }
+
+ @action
+ onRowClick(element: unknown, e?: Event) {
+ console.log('Row clicked:', element, e);
+ }
+
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-ui/prefabs/tpk-form.gts b/doc-app/app/components/docs/ember-ui/prefabs/tpk-form.gts
new file mode 100644
index 00000000..eec8fae4
--- /dev/null
+++ b/doc-app/app/components/docs/ember-ui/prefabs/tpk-form.gts
@@ -0,0 +1,57 @@
+import Component from '@glimmer/component';
+import { action } from '@ember/object';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import { object, string } from 'zod';
+import TpkForm from '@triptyk/ember-input-validation/components/tpk-form';
+
+export default class TpkFormExample extends Component {
+ // Initialize an empty changeset
+ changeset = new ImmerChangeset({
+ firstName: '',
+ lastName: '',
+ email: '',
+ });
+
+ // Define validation rules with Zod
+ validationSchema = object({
+ firstName: string().min(2, 'First name must be at least 2 characters'),
+ lastName: string().min(2, 'Last name must be at least 2 characters'),
+ email: string().email('Must be a valid email address'),
+ });
+
+ @action
+ handleSubmit(
+ validatedData: {
+ firstName: string;
+ lastName: string;
+ email: string;
+ },
+ changeset: ImmerChangeset<{
+ firstName: string;
+ lastName: string;
+ email: string;
+ }>
+ ) {
+ // validatedData contains the validated form data
+ // changeset is the ImmerChangeset instance
+ console.log('Form submitted with:', validatedData, changeset);
+ alert('Form submitted successfully!');
+ }
+
+
+
+
+
+
+
+
+
+ Submit
+
+
+}
diff --git a/doc-app/app/components/docs/ember-ui/prefabs/tpk-form/base-components.gts b/doc-app/app/components/docs/ember-ui/prefabs/tpk-form/base-components.gts
new file mode 100644
index 00000000..08a9df92
--- /dev/null
+++ b/doc-app/app/components/docs/ember-ui/prefabs/tpk-form/base-components.gts
@@ -0,0 +1,49 @@
+import Component from '@glimmer/component';
+import { action } from '@ember/object';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import { object, string } from 'zod';
+import TpkForm from '@triptyk/ember-input-validation/components/tpk-form';
+
+export default class TpkFormBaseComponentsExample extends Component {
+ changeset = new ImmerChangeset({
+ username: '',
+ });
+
+ validationSchema = object({
+ username: string().min(3, 'Username must be at least 3 characters'),
+ });
+
+ @action
+ handleSubmit(validatedData: { username: string }) {
+ console.log('Form submitted with:', validatedData);
+ alert('Form submitted successfully!');
+ }
+
+ errorMessage(error: Record): string {
+ const message = error['message'];
+ return typeof message === 'string' ? message : '';
+ }
+
+
+
+
+
+
+ {{#if I.errors}}
+
+ {{#each I.errors as |error|}}
+
{{this.errorMessage error}}
+ {{/each}}
+
+ {{/if}}
+
+
+ Submit
+
+
+}
diff --git a/doc-app/app/components/docs/ember-ui/prefabs/tpk-form/changeset-get.gts b/doc-app/app/components/docs/ember-ui/prefabs/tpk-form/changeset-get.gts
new file mode 100644
index 00000000..ccf9b263
--- /dev/null
+++ b/doc-app/app/components/docs/ember-ui/prefabs/tpk-form/changeset-get.gts
@@ -0,0 +1,43 @@
+import Component from '@glimmer/component';
+import { action } from '@ember/object';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import { object, string } from 'zod';
+import TpkForm from '@triptyk/ember-input-validation/components/tpk-form';
+
+export default class TpkFormChangesetGetExample extends Component {
+ changeset = new ImmerChangeset({
+ firstName: '',
+ lastName: '',
+ });
+
+ validationSchema = object({
+ firstName: string().min(2, 'First name must be at least 2 characters'),
+ lastName: string().min(2, 'Last name must be at least 2 characters'),
+ });
+
+ @action
+ handleSubmit(validatedData: { firstName: string; lastName: string }) {
+ console.log('Form submitted with:', validatedData);
+ alert('Form submitted successfully!');
+ }
+
+
+
+
+
+
+
+ Full name:
+ {{String (F.changesetGet "firstName")}}
+ {{String (F.changesetGet "lastName")}}
+
+
+ Submit
+
+
+}
diff --git a/doc-app/app/components/docs/ember-ui/prefabs/tpk-form/disabled-state.gts b/doc-app/app/components/docs/ember-ui/prefabs/tpk-form/disabled-state.gts
new file mode 100644
index 00000000..cafd34f5
--- /dev/null
+++ b/doc-app/app/components/docs/ember-ui/prefabs/tpk-form/disabled-state.gts
@@ -0,0 +1,53 @@
+import Component from '@glimmer/component';
+import { action } from '@ember/object';
+import { tracked } from '@glimmer/tracking';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import { object, string } from 'zod';
+import TpkForm from '@triptyk/ember-input-validation/components/tpk-form';
+import { on } from '@ember/modifier';
+
+export default class TpkFormDisabledStateExample extends Component {
+ @tracked isLoading = false;
+
+ changeset = new ImmerChangeset({
+ name: '',
+ });
+
+ validationSchema = object({
+ name: string().min(2, 'Name must be at least 2 characters'),
+ });
+
+ @action
+ handleSubmit(validatedData: { name: string }) {
+ this.isLoading = true;
+ setTimeout(() => {
+ console.log('Form submitted with:', validatedData);
+ alert('Form submitted successfully!');
+ this.isLoading = false;
+ }, 1000);
+ }
+
+ @action
+ toggleLoading() {
+ this.isLoading = !this.isLoading;
+ }
+
+
+
+
+ {{if this.isLoading "Enable Form" "Disable Form"}}
+
+
+
+
+ Submit
+
+
+
+}
diff --git a/doc-app/app/components/docs/ember-ui/prefabs/tpk-form/error-handling.gts b/doc-app/app/components/docs/ember-ui/prefabs/tpk-form/error-handling.gts
new file mode 100644
index 00000000..9e5ae1bb
--- /dev/null
+++ b/doc-app/app/components/docs/ember-ui/prefabs/tpk-form/error-handling.gts
@@ -0,0 +1,38 @@
+import Component from '@glimmer/component';
+import { action } from '@ember/object';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import { object, string } from 'zod';
+import TpkForm from '@triptyk/ember-input-validation/components/tpk-form';
+
+export default class TpkFormErrorHandlingExample extends Component {
+ changeset = new ImmerChangeset({
+ field1: '',
+ field2: '',
+ });
+
+ validationSchema = object({
+ field1: string().min(3, 'Field 1 must be at least 3 characters'),
+ field2: string().min(3, 'Field 2 must be at least 3 characters'),
+ });
+
+ @action
+ handleSubmit(validatedData: { field1: string; field2: string }) {
+ console.log('Form submitted with:', validatedData);
+ alert('Form submitted successfully!');
+ }
+
+
+
+
+
+ Submit
+
+
+}
diff --git a/doc-app/app/components/docs/ember-ui/prefabs/tpk-form/reactive-validation.gts b/doc-app/app/components/docs/ember-ui/prefabs/tpk-form/reactive-validation.gts
new file mode 100644
index 00000000..1e0b222e
--- /dev/null
+++ b/doc-app/app/components/docs/ember-ui/prefabs/tpk-form/reactive-validation.gts
@@ -0,0 +1,34 @@
+import Component from '@glimmer/component';
+import { action } from '@ember/object';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import { object, string } from 'zod';
+import TpkForm from '@triptyk/ember-input-validation/components/tpk-form';
+
+export default class TpkFormReactiveValidationExample extends Component {
+ changeset = new ImmerChangeset({
+ email: '',
+ });
+
+ validationSchema = object({
+ email: string().email('Must be a valid email address'),
+ });
+
+ @action
+ handleSubmit(validatedData: { email: string }) {
+ console.log('Form submitted with:', validatedData);
+ alert('Form submitted successfully!');
+ }
+
+
+
+
+ Submit
+
+
+}
diff --git a/doc-app/app/components/docs/ember-ui/prefabs/tpk-form/required-fields.gts b/doc-app/app/components/docs/ember-ui/prefabs/tpk-form/required-fields.gts
new file mode 100644
index 00000000..d544dc89
--- /dev/null
+++ b/doc-app/app/components/docs/ember-ui/prefabs/tpk-form/required-fields.gts
@@ -0,0 +1,46 @@
+import Component from '@glimmer/component';
+import { action } from '@ember/object';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import { object, string } from 'zod';
+import TpkForm from '@triptyk/ember-input-validation/components/tpk-form';
+
+export default class TpkFormRequiredFieldsExample extends Component {
+ changeset = new ImmerChangeset({
+ name: '',
+ email: '',
+ });
+
+ validationSchema = object({
+ name: string().min(2, 'Name must be at least 2 characters'),
+ email: string().email('Must be a valid email address'),
+ });
+
+ @action
+ handleSubmit(validatedData: { name: string; email: string }) {
+ console.log('Form submitted with:', validatedData);
+ alert('Form submitted successfully!');
+ }
+
+ includes = (array: string[], value: string) => array.includes(value);
+
+
+
+ Required fields:
+ {{F.requiredFields.length}}
+
+
+
+ {{#if (this.includes F.requiredFields "email")}}
+ Email is required
+ {{/if}}
+
+
+ Submit
+
+
+}
diff --git a/doc-app/app/components/docs/ember-ui/prefabs/tpk-form/submit-only-validation.gts b/doc-app/app/components/docs/ember-ui/prefabs/tpk-form/submit-only-validation.gts
new file mode 100644
index 00000000..972053b4
--- /dev/null
+++ b/doc-app/app/components/docs/ember-ui/prefabs/tpk-form/submit-only-validation.gts
@@ -0,0 +1,34 @@
+import Component from '@glimmer/component';
+import { action } from '@ember/object';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import { object, string } from 'zod';
+import TpkForm from '@triptyk/ember-input-validation/components/tpk-form';
+
+export default class TpkFormSubmitOnlyValidationExample extends Component {
+ changeset = new ImmerChangeset({
+ email: '',
+ });
+
+ validationSchema = object({
+ email: string().email('Must be a valid email address'),
+ });
+
+ @action
+ handleSubmit(validatedData: { email: string }) {
+ console.log('Form submitted with:', validatedData);
+ alert('Form submitted successfully!');
+ }
+
+
+
+
+ Submit
+
+
+}
diff --git a/doc-app/app/components/dummy-form.gts b/doc-app/app/components/dummy-form.gts
new file mode 100644
index 00000000..ce91bea8
--- /dev/null
+++ b/doc-app/app/components/dummy-form.gts
@@ -0,0 +1,118 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { action } from '@ember/object';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import {
+ object,
+ string,
+ date,
+ boolean,
+ array,
+ email,
+ union,
+ literal,
+} from 'zod';
+import TpkForm from '@triptyk/ember-input-validation/components/tpk-form';
+
+export default class DummyFormComponent extends Component {
+ @tracked changeset = new ImmerChangeset({
+ firstName: '',
+ lastName: '',
+ email: '',
+ phone: '',
+ birthday: null,
+ languages: [],
+ password: '',
+ agreed: false,
+ description: '',
+ });
+
+ validationSchema = object({
+ firstName: string(),
+ lastName: string().min(2, 'At least 2 characters'),
+ email: union([literal(''), email()]), // allow empty string or email
+ phone: string(),
+ birthday: date().max(new Date(), 'Cannot be in the future'),
+ languages: array(string()).min(1, 'Select at least one language'),
+ password: string().min(8, 'At least 8 characters'),
+ agreed: boolean().refine((value) => value === true, 'You must agree'),
+ description: string().max(500, 'Maximum 500 characters'),
+ });
+
+ languageOptions = [
+ {
+ value: 'fr',
+ label: 'French',
+ toString: function () {
+ return this.label;
+ },
+ },
+ {
+ value: 'en',
+ label: 'English',
+ toString: function () {
+ return this.label;
+ },
+ },
+ {
+ value: 'es',
+ label: 'Spanish',
+ toString: function () {
+ return this.label;
+ },
+ },
+ {
+ value: 'de',
+ label: 'German',
+ toString: function () {
+ return this.label;
+ },
+ },
+ ];
+
+ @action
+ onSubmit() {
+ alert('Form submitted successfully!');
+ }
+
+ @action
+ onChange(value: unknown) {
+ console.log('Value changed:', value);
+ }
+
+
+
+
Dummy Form
+
+
+
+
+
+
+
+
+
+
+ Submit
+
+
+
+}
diff --git a/doc-app/app/components/dummy-label-select.gts b/doc-app/app/components/dummy-label-select.gts
index fbc9c986..bde481fd 100644
--- a/doc-app/app/components/dummy-label-select.gts
+++ b/doc-app/app/components/dummy-label-select.gts
@@ -1,4 +1,4 @@
-import type { TOC } from "@ember/component/template-only";
+import type { TOC } from '@ember/component/template-only';
interface Args {
labelText: string;
diff --git a/doc-app/app/components/theme-selector.gts b/doc-app/app/components/theme-selector.gts
new file mode 100644
index 00000000..664c691c
--- /dev/null
+++ b/doc-app/app/components/theme-selector.gts
@@ -0,0 +1,125 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { action } from '@ember/object';
+import { fn } from '@ember/helper';
+import { on } from '@ember/modifier';
+import type Owner from '@ember/owner';
+
+const THEMES = ['nord', 'dracula', 'cupcake', 'corporate', 'lemonade'] as const;
+
+interface ThemeSelectorSignature {
+ Args: {
+ sidebarCollapsed?: boolean;
+ };
+}
+
+export default class ThemeSelector extends Component {
+ @tracked currentTheme = 'nord';
+ @tracked themeDropdownOpen = false;
+
+ constructor(owner: Owner, args: ThemeSelectorSignature['Args']) {
+ super(owner, args);
+ let theme = 'nord';
+ if (typeof localStorage !== 'undefined') {
+ theme = localStorage.getItem('doc-app-theme') ?? 'nord';
+ }
+ this.currentTheme = theme;
+ if (typeof document !== 'undefined') {
+ document.documentElement.setAttribute('data-theme', theme);
+ }
+ }
+
+ THEMES = THEMES;
+
+ @action
+ setTheme(themeName: string) {
+ this.currentTheme = themeName;
+ this.themeDropdownOpen = false;
+ if (typeof document !== 'undefined') {
+ document.documentElement.setAttribute('data-theme', themeName);
+ }
+ if (typeof localStorage !== 'undefined') {
+ localStorage.setItem('doc-app-theme', themeName);
+ }
+ }
+
+ @action
+ toggleThemeDropdown() {
+ this.themeDropdownOpen = !this.themeDropdownOpen;
+ }
+
+ @action
+ isCurrentTheme(themeName: string): boolean {
+ return this.currentTheme === themeName;
+ }
+
+
+
+
+}
diff --git a/doc-app/app/config/environment.d.ts b/doc-app/app/config/environment.d.ts
deleted file mode 100644
index 3dffaa8b..00000000
--- a/doc-app/app/config/environment.d.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-/**
- * Type declarations for
- * import config from 'doc-app/config/environment'
- */
-declare const config: {
- environment: string;
- modulePrefix: string;
- podModulePrefix: string;
- locationType: 'history' | 'hash' | 'none';
- rootURL: string;
- APP: Record;
-};
-
-export default config;
diff --git a/doc-app/app/config/environment.ts b/doc-app/app/config/environment.ts
new file mode 100644
index 00000000..53c0e21e
--- /dev/null
+++ b/doc-app/app/config/environment.ts
@@ -0,0 +1,33 @@
+import loadConfigFromMeta from '@embroider/config-meta-loader';
+import { assert } from '@ember/debug';
+
+const config = loadConfigFromMeta('doc-app') as unknown;
+
+assert(
+ 'config is not an object',
+ typeof config === 'object' && config !== null
+);
+assert(
+ 'modulePrefix was not detected on your config',
+ 'modulePrefix' in config && typeof config.modulePrefix === 'string'
+);
+assert(
+ 'locationType was not detected on your config',
+ 'locationType' in config && typeof config.locationType === 'string'
+);
+assert(
+ 'rootURL was not detected on your config',
+ 'rootURL' in config && typeof config.rootURL === 'string'
+);
+assert(
+ 'APP was not detected on your config',
+ 'APP' in config && typeof config.APP === 'object'
+);
+
+export default config as {
+ modulePrefix: string;
+ podModulePrefix?: string;
+ locationType: string;
+ rootURL: string;
+ APP: Record;
+} & Record;
diff --git a/doc-app/app/controllers/docs/.DS_Store b/doc-app/app/controllers/docs/.DS_Store
deleted file mode 100644
index 21edadea..00000000
Binary files a/doc-app/app/controllers/docs/.DS_Store and /dev/null differ
diff --git a/doc-app/app/controllers/docs/ember-input-validation/checkbox.ts b/doc-app/app/controllers/docs/ember-input-validation/checkbox.ts
deleted file mode 100644
index e784734c..00000000
--- a/doc-app/app/controllers/docs/ember-input-validation/checkbox.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-import Controller from '@ember/controller';
-import { action } from '@ember/object';
-import { tracked } from 'tracked-built-ins';
-import { ImmerChangeset } from 'ember-immer-changeset';
-
-export default class DocsCheckboxValidationController extends Controller {
- label = "I'm a beast";
- changeset = new ImmerChangeset({
- checked: true,
- });
-
- @action
- onChange(value: boolean) {
- this.changeset.set('checked', value);
- this.changeset.save();
- if (!this.changeset.get('checked')) {
- this.changeset.addError({
- message: 'Check to be a beast',
- value: true,
- originalValue: true,
- key: 'checked',
- });
- } else {
- this.changeset.removeError('checked');
- }
- }
-}
diff --git a/doc-app/app/controllers/docs/ember-input-validation/input.ts b/doc-app/app/controllers/docs/ember-input-validation/input.ts
deleted file mode 100644
index ce66ba62..00000000
--- a/doc-app/app/controllers/docs/ember-input-validation/input.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-import Controller from '@ember/controller';
-import { action } from '@ember/object';
-import { tracked } from 'tracked-built-ins';
-import { ImmerChangeset } from 'ember-immer-changeset';
-
-export default class DocsInputValidationController extends Controller {
- label = 'Clear it';
- changeset = new ImmerChangeset({
- delete_text: 'Delete my text',
- });
-
- @action
- onChange(value: string) {
- this.changeset.set('delete_text', value);
- this.changeset.save();
- if (this.changeset.get('delete_text') === '') {
- this.changeset.addError({
- message: 'Why did you do that? Why??',
- value: '',
- originalValue: '',
- key: 'delete_text',
- });
- } else {
- this.changeset.removeError('delete_text');
- }
- }
-}
diff --git a/doc-app/app/controllers/docs/ember-input-validation/prefabs/bic.ts b/doc-app/app/controllers/docs/ember-input-validation/prefabs/bic.ts
deleted file mode 100644
index 36c6b23e..00000000
--- a/doc-app/app/controllers/docs/ember-input-validation/prefabs/bic.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-import Controller from '@ember/controller';
-import { ImmerChangeset } from 'ember-immer-changeset';
-import { tracked } from '@glimmer/tracking';
-import type { Owner } from '@ember/test-helpers/build-owner';
-
-export default class DocsEmberInputValidationPrefabsIBANController extends Controller {
- changeset = new ImmerChangeset({
- bic: '',
- disabled: 'UKIO0000',
- });
-
- changesetWithErrors = new ImmerChangeset({
- bic: 'UKIO0000',
- });
-
- constructor(owner: Owner) {
- super(owner);
- this.changesetWithErrors.addError({
- message: 'This bic is invalid',
- value: '',
- originalValue: '',
- key: 'bic',
- });
- }
-}
diff --git a/doc-app/app/controllers/docs/ember-input-validation/prefabs/checkbox.ts b/doc-app/app/controllers/docs/ember-input-validation/prefabs/checkbox.ts
deleted file mode 100644
index 1414f9a8..00000000
--- a/doc-app/app/controllers/docs/ember-input-validation/prefabs/checkbox.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-import Controller from '@ember/controller';
-import { ImmerChangeset } from 'ember-immer-changeset';
-import { tracked } from '@glimmer/tracking';
-import type { Owner } from '@ember/test-helpers/build-owner';
-
-export default class DocsEmberInputValidationPrefabsCheckboxController extends Controller {
- changeset = new ImmerChangeset({
- disabled: true,
- unchecked: false,
- checked: true,
- error: true,
- });
-
- constructor(owner: Owner) {
- super(owner);
- this.changeset.addError({
- message: 'This is an error message',
- value: '',
- originalValue: '',
- key: 'error',
- });
- }
-}
diff --git a/doc-app/app/controllers/docs/ember-input-validation/prefabs/currency.ts b/doc-app/app/controllers/docs/ember-input-validation/prefabs/currency.ts
deleted file mode 100644
index bb5c7ec5..00000000
--- a/doc-app/app/controllers/docs/ember-input-validation/prefabs/currency.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import Controller from '@ember/controller';
-import { ImmerChangeset } from 'ember-immer-changeset';
-import { tracked } from '@glimmer/tracking';
-import type { Owner } from '@ember/test-helpers/build-owner';
-
-export default class DocsEmberInputValidationPrefabsCurrencyController extends Controller {
- changeset = new ImmerChangeset({
- value: undefined,
- disabled: 0.03,
- error: 34020.03,
- });
-
- constructor(owner: Owner) {
- super(owner);
- this.changeset.addError({
- message: 'This is an error message',
- value: '',
- originalValue: '',
- key: 'error',
- });
- }
-}
diff --git a/doc-app/app/controllers/docs/ember-input-validation/prefabs/datepicker-range.ts b/doc-app/app/controllers/docs/ember-input-validation/prefabs/datepicker-range.ts
deleted file mode 100644
index 31fa5e82..00000000
--- a/doc-app/app/controllers/docs/ember-input-validation/prefabs/datepicker-range.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import Controller from '@ember/controller';
-import { ImmerChangeset } from 'ember-immer-changeset';
-import { tracked } from '@glimmer/tracking';
-import type { Owner } from '@ember/test-helpers/build-owner';
-
-export default class DocsEmberInputValidationPrefabsDatepickerRangeController extends Controller {
- changeset = new ImmerChangeset({
- range: null,
- disabled: null,
- error: null,
- });
-
- constructor(owner: Owner) {
- super(owner);
- this.changeset.addError({
- message: 'This is an error message',
- value: '',
- originalValue: '',
- key: 'error',
- });
- }
-}
diff --git a/doc-app/app/controllers/docs/ember-input-validation/prefabs/datepicker.ts b/doc-app/app/controllers/docs/ember-input-validation/prefabs/datepicker.ts
deleted file mode 100644
index 08eaa8b9..00000000
--- a/doc-app/app/controllers/docs/ember-input-validation/prefabs/datepicker.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import Controller from '@ember/controller';
-import { ImmerChangeset } from 'ember-immer-changeset';
-import { tracked } from '@glimmer/tracking';
-import type { Owner } from '@ember/test-helpers/build-owner';
-
-export default class DocsEmberInputValidationPrefabsDatepickerController extends Controller {
- changeset = new ImmerChangeset({
- birthday: null,
- disabled: null,
- error: null,
- });
-
- constructor(owner: Owner) {
- super(owner);
- this.changeset.addError({
- message: 'This is an error message',
- value: '',
- originalValue: '',
- key: 'error',
- });
- }
-}
diff --git a/doc-app/app/controllers/docs/ember-input-validation/prefabs/email.ts b/doc-app/app/controllers/docs/ember-input-validation/prefabs/email.ts
deleted file mode 100644
index ae603148..00000000
--- a/doc-app/app/controllers/docs/ember-input-validation/prefabs/email.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-import Controller from '@ember/controller';
-import { action } from '@ember/object';
-import { ImmerChangeset } from 'ember-immer-changeset';
-import { tracked } from '@glimmer/tracking';
-import type { Owner } from '@ember/test-helpers/build-owner';
-
-export default class DocsEmberInputValidationPrefabsEmailController extends Controller {
- changeset = new ImmerChangeset({
- email: undefined,
- disabled: 'email@disabled.true',
- error: 'hyperloop.com',
- });
-
- constructor(owner: Owner) {
- super(owner);
- this.changeset.addError({
- message: 'This is an error message',
- value: '',
- originalValue: '',
- key: 'error',
- });
- }
-
-}
diff --git a/doc-app/app/controllers/docs/ember-input-validation/prefabs/file-list.ts b/doc-app/app/controllers/docs/ember-input-validation/prefabs/file-list.ts
deleted file mode 100644
index f517cec2..00000000
--- a/doc-app/app/controllers/docs/ember-input-validation/prefabs/file-list.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import Controller from '@ember/controller';
-import { action } from '@ember/object';
-import { ImmerChangeset } from 'ember-immer-changeset';
-import type { Owner } from '@ember/test-helpers/build-owner';
-
-export default class DocsEmberInputValidationPrefabsFileListController extends Controller {
- changeset = new ImmerChangeset({
- files: [new File([], 'file.txt')],
- disabled: [new File([], 'file.txt')],
- error: '',
- });
-
- constructor(owner: Owner) {
- super(owner);
- this.changeset.addError({
- message: 'This is an error message',
- value: '',
- originalValue: '',
- key: 'error',
- });
- }
-}
diff --git a/doc-app/app/controllers/docs/ember-input-validation/prefabs/file.ts b/doc-app/app/controllers/docs/ember-input-validation/prefabs/file.ts
deleted file mode 100644
index 94d1d1ec..00000000
--- a/doc-app/app/controllers/docs/ember-input-validation/prefabs/file.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-import Controller from '@ember/controller';
-import { action } from '@ember/object';
-import { ImmerChangeset } from 'ember-immer-changeset';
-import { tracked } from '@glimmer/tracking';
-import type { Owner } from '@ember/test-helpers/build-owner';
-
-export default class DocsEmberInputValidationPrefabsFileController extends Controller {
- changeset = new ImmerChangeset({
- file: new File([], 'file.txt'),
- disabled: '',
- error: '',
- });
-
- constructor(owner: Owner) {
- super(owner);
- this.changeset.addError({
- message: 'This is an error message',
- value: '',
- originalValue: '',
- key: 'error',
- });
- }
-}
diff --git a/doc-app/app/controllers/docs/ember-input-validation/prefabs/iban.ts b/doc-app/app/controllers/docs/ember-input-validation/prefabs/iban.ts
deleted file mode 100644
index 9c3dabf4..00000000
--- a/doc-app/app/controllers/docs/ember-input-validation/prefabs/iban.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import Controller from '@ember/controller';
-import { ImmerChangeset } from 'ember-immer-changeset';
-import { tracked } from '@glimmer/tracking';
-import type { Owner } from '@ember/test-helpers/build-owner';
-
-export default class DocsEmberInputValidationPrefabsIBANController extends Controller {
- changeset = new ImmerChangeset({
- iban: '',
- error: 'bad iban',
- disabled: 'disabled',
- });
-
- constructor(owner: Owner) {
- super(owner);
- this.changeset.addError({
- message: 'This is an error message',
- value: '',
- originalValue: '',
- key: 'error',
- });
- }
-}
diff --git a/doc-app/app/controllers/docs/ember-input-validation/prefabs/input.ts b/doc-app/app/controllers/docs/ember-input-validation/prefabs/input.ts
deleted file mode 100644
index 0af0e429..00000000
--- a/doc-app/app/controllers/docs/ember-input-validation/prefabs/input.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-import Controller from '@ember/controller';
-import { ImmerChangeset } from 'ember-immer-changeset';
-import { tracked } from '@glimmer/tracking';
-import type { Owner } from '@ember/test-helpers/build-owner';
-
-export default class DocsEmberInputValidationPrefabsInputController extends Controller {
- changeset = new ImmerChangeset({
- something: '',
- disabled: 'text',
- });
-
- changesetWithErrors = new ImmerChangeset({
- something: '',
- });
-
- constructor(owner: Owner) {
- super(owner);
- this.changesetWithErrors.addError({
- message: 'This is an error message',
- value: '',
- originalValue: '',
- key: 'something',
- });
- }
-}
diff --git a/doc-app/app/controllers/docs/ember-input-validation/prefabs/integer.ts b/doc-app/app/controllers/docs/ember-input-validation/prefabs/integer.ts
deleted file mode 100644
index d0cc4b90..00000000
--- a/doc-app/app/controllers/docs/ember-input-validation/prefabs/integer.ts
+++ /dev/null
@@ -1,37 +0,0 @@
-import Controller from '@ember/controller';
-import { action } from '@ember/object';
-import { tracked } from 'tracked-built-ins';
-import { ImmerChangeset } from 'ember-immer-changeset';
-import type { Owner } from '@ember/test-helpers/build-owner';
-
-export default class DocsEmberInputValidationPrefabsIntegerController extends Controller {
- changeset = new ImmerChangeset({
- integer: 0,
- uInteger: 0,
- });
-
- changesetWithErrors = new ImmerChangeset({
- integer: 0,
- uInteger: 0,
- });
-
- public constructor(owner: Owner) {
- super(owner);
- this.changesetWithErrors.addError({
- message: 'This integer is invalid',
- value: '',
- originalValue: '',
- key: 'integer',
- });
- }
-
- @action
- onChangeInteger(value: number) {
- this.changeset.set('integer', value);
- }
-
- @action
- onChangeUInteger(value: number) {
- this.changeset.set('uInteger', value);
- }
-}
diff --git a/doc-app/app/controllers/docs/ember-input-validation/prefabs/mobile.ts b/doc-app/app/controllers/docs/ember-input-validation/prefabs/mobile.ts
deleted file mode 100644
index 4a2eb4d2..00000000
--- a/doc-app/app/controllers/docs/ember-input-validation/prefabs/mobile.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import Controller from '@ember/controller';
-import { ImmerChangeset } from 'ember-immer-changeset';
-import { tracked } from '@glimmer/tracking';
-import type { Owner } from '@ember/test-helpers/build-owner';
-
-export default class DocsEmberInputValidationPrefabsPhoneController extends Controller {
- changeset = new ImmerChangeset({
- phone: '',
- error: '',
- disabled: '',
- });
- constructor(owner: Owner) {
- super(owner);
- this.changeset.addError({
- message: 'This is an error message',
- value: '',
- originalValue: '',
- key: 'error',
- });
- }
-}
diff --git a/doc-app/app/controllers/docs/ember-input-validation/prefabs/national-number.ts b/doc-app/app/controllers/docs/ember-input-validation/prefabs/national-number.ts
deleted file mode 100644
index e69cfb9e..00000000
--- a/doc-app/app/controllers/docs/ember-input-validation/prefabs/national-number.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-import Controller from '@ember/controller';
-import { ImmerChangeset } from 'ember-immer-changeset';
-import { tracked } from '@glimmer/tracking';
-import type Owner from '@ember/owner';
-
-export default class DocsEmberInputValidationPrefabsNationalNumberController extends Controller {
- changeset = new ImmerChangeset({
- nationalNumber: '',
- });
-
- changesetWithErrors = new ImmerChangeset({
- nationalNumber: '',
- });
-
- public constructor(owner: Owner) {
- super(owner);
- this.changesetWithErrors.addError({
- key: 'nationalNumber',
- value: '',
- originalValue: '',
-
- message: 'This is not a valid national number',
- })
- }
-}
diff --git a/doc-app/app/controllers/docs/ember-input-validation/prefabs/number.ts b/doc-app/app/controllers/docs/ember-input-validation/prefabs/number.ts
deleted file mode 100644
index b51b4040..00000000
--- a/doc-app/app/controllers/docs/ember-input-validation/prefabs/number.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-import Controller from '@ember/controller';
-import { action } from '@ember/object';
-import { tracked } from 'tracked-built-ins';
-import { ImmerChangeset } from 'ember-immer-changeset';
-import type { Owner } from '@ember/test-helpers/build-owner';
-
-export default class DocsEmberInputValidationPrefabsNumberController extends Controller {
- changeset = new ImmerChangeset({
- number: 0,
- uNumber: 0,
- });
-
- changesetWithErrors = new ImmerChangeset({
- number: 0,
- });
-
- public constructor(owner: Owner) {
- super(owner);
-
- this.changesetWithErrors.addError({
- value: '0',
- originalValue: 0,
- key: 'number',
- message: 'This is an error message',
- });
- }
-
- @action
- onChangeNumber(value: number) {
- this.changeset.set('number', value);
- }
-
- onChangeUNumber(value: number) {
- this.changeset.set('uNumber', value);
- }
-}
diff --git a/doc-app/app/controllers/docs/ember-input-validation/prefabs/password.ts b/doc-app/app/controllers/docs/ember-input-validation/prefabs/password.ts
deleted file mode 100644
index f7d0a413..00000000
--- a/doc-app/app/controllers/docs/ember-input-validation/prefabs/password.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-import Controller from '@ember/controller';
-import { ImmerChangeset } from 'ember-immer-changeset';
-import { tracked } from '@glimmer/tracking';
-import type Owner from '@ember/owner';
-
-export default class DocsEmberInputValidationPrefabsPasswordController extends Controller {
- changeset = new ImmerChangeset({
- name: '',
- });
-
- changesetWithErrors = new ImmerChangeset({
- name: '',
- });
-
- public constructor(owner: Owner) {
- super(owner);
-
- this.changesetWithErrors.addError({
- value: '0',
- originalValue: 0,
- key: 'name',
- message: 'This is an error message',
- });
- }
-}
diff --git a/doc-app/app/controllers/docs/ember-input-validation/prefabs/radio-group.ts b/doc-app/app/controllers/docs/ember-input-validation/prefabs/radio-group.ts
deleted file mode 100644
index bafd9b26..00000000
--- a/doc-app/app/controllers/docs/ember-input-validation/prefabs/radio-group.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-import Controller from '@ember/controller';
-import { action } from '@ember/object';
-import { tracked } from 'tracked-built-ins';
-import { ImmerChangeset } from 'ember-immer-changeset';
-import type Owner from '@ember/owner';
-
-export default class DocsEmberInputValidationPrefabsRadioGroupController extends Controller {
- changeset = new ImmerChangeset({
- radio: undefined,
- });
-
- changesetWithErrors = new ImmerChangeset({
- radio: undefined,
- });
-
- public constructor(owner: Owner) {
- super(owner);
- this.changesetWithErrors.addError({
- key: 'radio',
- message: 'Invalid value',
- value: 'Invalid value',
- originalValue : ''
- });
- }
-
- @action
- onChange() {
-
- }
-}
diff --git a/doc-app/app/controllers/docs/ember-input-validation/prefabs/radio.ts b/doc-app/app/controllers/docs/ember-input-validation/prefabs/radio.ts
deleted file mode 100644
index d3cf9c78..00000000
--- a/doc-app/app/controllers/docs/ember-input-validation/prefabs/radio.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-import Controller from '@ember/controller';
-import { ImmerChangeset } from 'ember-immer-changeset';
-import { action } from '@ember/object';
-import type Owner from '@ember/owner';
-
-export default class DocsEmberInputValidationPrefabsRadioController extends Controller {
- changeset = new ImmerChangeset({
- radio: '',
- });
-
- changesetWithErrors = new ImmerChangeset({
- radio: '',
- });
-
- public constructor(owner: Owner) {
- super(owner);
- this.changesetWithErrors.addError({
- key: 'radio',
- message: 'Invalid value',
- value: 'Invalid value',
- originalValue : ''
- });
- }
-
- @action
- onChange(e: Event) {
- console.log('onChange', e);
- }
-}
diff --git a/doc-app/app/controllers/docs/ember-input-validation/prefabs/select-create.ts b/doc-app/app/controllers/docs/ember-input-validation/prefabs/select-create.ts
deleted file mode 100644
index edb2500e..00000000
--- a/doc-app/app/controllers/docs/ember-input-validation/prefabs/select-create.ts
+++ /dev/null
@@ -1,84 +0,0 @@
-import Controller from '@ember/controller';
-import { ImmerChangeset } from 'ember-immer-changeset';
-import { tracked } from '@glimmer/tracking';
-import { action } from '@ember/object';
-import type Owner from '@ember/owner';
-
-function configureDisplay(obj: T, format: (obj: T) => string) {
- return {
- ...obj,
- toString() {
- return format(this);
- },
- };
-}
-
-interface ChangesetType {
- ceo?: { firstname: string };
- disabled?: { firstname: string };
- error?: { firstname: string };
-}
-
-interface ChangesetBisType {
- ceo: { firstname: string }[];
-}
-
-export default class DocsEmberInputValidationPrefabsSelectCreateController extends Controller {
- constructor(owner: Owner) {
- super(owner);
- this.changeset.addError({
- message: 'This is an error message',
- value: '',
- originalValue: '',
- key: 'error',
- });
- }
-
- changeset = new ImmerChangeset({
- ceo: undefined,
- disabled: undefined,
- error: undefined,
- });
-
- changesetBis = new ImmerChangeset({
- ceo: [],
- });
-
- @tracked options = [
- { firstname: 'Patrick' },
- { firstname: 'Romain' },
- { firstname: 'Gilles' },
- ].map((o) => configureDisplay(o, (option) => option.firstname));
-
- @action
- onCreate(value: string) {
- const newValue = configureDisplay(
- { firstname: value },
- (option) => option.firstname,
- );
- this.options = [...this.options, newValue];
- this.changeset.set('ceo', newValue);
- }
-
- @action
- onCreateBis(value: string) {
- console.log(value);
- const newValue = configureDisplay(
- { firstname: value },
- (option) => option.firstname,
- );
- this.options = [...this.options, newValue];
- this.changesetBis.set('ceo', [...this.changesetBis.get('ceo'), newValue]);
- }
-
- @action
- buildSuggestion(term: string) {
- return `Créer "${term}"...`;
- }
-
- @action
- showCreateWhen(term: string) {
- const existingOption = this.options.find((name) => name.firstname === term);
- return !existingOption;
- }
-}
diff --git a/doc-app/app/controllers/docs/ember-input-validation/prefabs/select-search.ts b/doc-app/app/controllers/docs/ember-input-validation/prefabs/select-search.ts
deleted file mode 100644
index d63cfd81..00000000
--- a/doc-app/app/controllers/docs/ember-input-validation/prefabs/select-search.ts
+++ /dev/null
@@ -1,57 +0,0 @@
-import Controller from '@ember/controller';
-import { ImmerChangeset } from 'ember-immer-changeset';
-import { tracked } from '@glimmer/tracking';
-import { action } from '@ember/object';
-import { restartableTask, timeout } from 'ember-concurrency';
-import type Owner from '@ember/owner';
-
-interface Option {
- name: string;
- toString(): string;
-}
-
-interface Changeset {
- repository: Option | undefined;
- disabled: Option | undefined;
- error: Option | undefined;
-}
-
-export default class DocsEmberInputValidationPrefabsSelectSearchController extends Controller {
- constructor(owner: Owner) {
- super(owner);
- this.changeset.addError({
- message: 'This is an error message',
- value: '',
- originalValue: '',
- key: 'error',
- });
- }
-
- changeset = new ImmerChangeset({
- repository: undefined,
- disabled: undefined,
- error: undefined,
- });
- @tracked options: Option[] = [];
-
- @restartableTask
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- *onSearch(value: string): any {
- yield timeout(300);
- const response = yield fetch(
- `https://api.github.com/search/repositories?q=${value}`,
- );
- const json: { items: { full_name: string }[] } = yield response.json();
- this.options = json.items.map((item) => ({
- name: item.full_name,
- toString() {
- return this.name;
- },
- }));
- }
-
- @action
- onChange(value: Option) {
- this.changeset.set('repository', value);
- }
-}
diff --git a/doc-app/app/controllers/docs/ember-input-validation/prefabs/select.ts b/doc-app/app/controllers/docs/ember-input-validation/prefabs/select.ts
deleted file mode 100644
index 63e68a2e..00000000
--- a/doc-app/app/controllers/docs/ember-input-validation/prefabs/select.ts
+++ /dev/null
@@ -1,55 +0,0 @@
-import Controller from '@ember/controller';
-import { ImmerChangeset } from 'ember-immer-changeset';
-import { tracked } from '@glimmer/tracking';
-import type { Owner } from '@ember/test-helpers/build-owner';
-
-function configureDisplay(obj: T, format: (obj: T) => string) {
- return {
- ...obj,
- toString() {
- return format(this);
- },
- };
-}
-
-export default class DocsEmberInputValidationPrefabsSelectController extends Controller {
- constructor(owner: Owner) {
- super(owner);
- this.changeset.addError({
- message: 'This is an error message',
- value: '',
- originalValue: '',
- key: 'error',
- });
- }
- changeset = new ImmerChangeset({
- ceo: configureDisplay(
- { firstname: 'Patrick', lastname: 'Pagnoulle' },
- (option) => `${option.firstname} ${option.lastname}`,
- ),
- disabled: configureDisplay(
- { firstname: 'Tils', lastname: 'Abled' },
- (option) => `${option.firstname} ${option.lastname}`,
- ),
- error: configureDisplay(
- { firstname: 'Err', lastname: 'Aur' },
- (option) => `${option.firstname} ${option.lastname}`,
- ),
- });
-
- changesetBis = new ImmerChangeset({
- ceo: undefined,
- });
-
- changesetTris = new ImmerChangeset({
- ceo: [],
- });
-
- @tracked options = [
- { firstname: 'Patrick', lastname: 'Pagnoulle' },
- { firstname: 'Romain', lastname: 'Verliefden' },
- { firstname: 'Gilles', lastname: 'Bertrand' },
- ].map((o) =>
- configureDisplay(o, (option) => `${option.firstname} ${option.lastname}`),
- );
-}
diff --git a/doc-app/app/controllers/docs/ember-input-validation/prefabs/textarea.ts b/doc-app/app/controllers/docs/ember-input-validation/prefabs/textarea.ts
deleted file mode 100644
index 9e96dee3..00000000
--- a/doc-app/app/controllers/docs/ember-input-validation/prefabs/textarea.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-import Controller from '@ember/controller';
-import { ImmerChangeset } from 'ember-immer-changeset';
-import { tracked } from '@glimmer/tracking';
-import type Owner from '@ember/owner';
-
-export default class DocsEmberInputValidationPrefabsTextareaController extends Controller {
- changeset = new ImmerChangeset({
- ember: '',
- });
-
- changesetWithErrors = new ImmerChangeset({
- ember: '',
- });
-
- public constructor(owner: Owner) {
- super(owner);
-
- this.changesetWithErrors.addError({
- key: 'ember',
- message: 'required',
- value: '',
- originalValue: '',
- })
- }
-}
diff --git a/doc-app/app/controllers/docs/ember-input-validation/prefabs/timepicker.ts b/doc-app/app/controllers/docs/ember-input-validation/prefabs/timepicker.ts
deleted file mode 100644
index e08dc5f0..00000000
--- a/doc-app/app/controllers/docs/ember-input-validation/prefabs/timepicker.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import Controller from '@ember/controller';
-import { ImmerChangeset } from 'ember-immer-changeset';
-import { tracked } from '@glimmer/tracking';
-import type Owner from '@ember/owner';
-
-export default class DocsEmberInputValidationPrefabsTimepickerController extends Controller {
- constructor(owner: Owner) {
- super(owner);
- this.changeset.addError({
- message: 'This is an error message',
- value: '',
- originalValue: '',
- key: 'error',
- });
- }
- changeset = new ImmerChangeset({
- time: null,
- disabled: null,
- error: null,
- });
-}
diff --git a/doc-app/app/controllers/docs/ember-input-validation/prefabs/vat.ts b/doc-app/app/controllers/docs/ember-input-validation/prefabs/vat.ts
deleted file mode 100644
index 8405a511..00000000
--- a/doc-app/app/controllers/docs/ember-input-validation/prefabs/vat.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import Controller from '@ember/controller';
-import { ImmerChangeset } from 'ember-immer-changeset';
-import { tracked } from '@glimmer/tracking';
-import type Owner from '@ember/owner';
-
-export default class DocsEmberInputValidationPrefabsVATController extends Controller {
- constructor(owner: Owner) {
- super(owner);
- this.changeset.addError({
- message: 'This is an error message',
- value: '',
- originalValue: '',
- key: 'error',
- });
- }
-
- changeset = new ImmerChangeset({
- vat: '',
- disabled: '',
- error: '',
- });
-}
diff --git a/doc-app/app/controllers/docs/ember-input-validation/radio-group.js b/doc-app/app/controllers/docs/ember-input-validation/radio-group.js
deleted file mode 100644
index cf987c17..00000000
--- a/doc-app/app/controllers/docs/ember-input-validation/radio-group.js
+++ /dev/null
@@ -1,16 +0,0 @@
-import Controller from '@ember/controller';
-import { action } from '@ember/object';
-import { tracked } from 'tracked-built-ins';
-import { ImmerChangeset } from 'ember-immer-changeset';
-
-export default class DocsRadioGroupValidationController extends Controller {
- changeset = new ImmerChangeset({
- radio: undefined,
- });
-
- @action
- onChange(value) {
- this.changeset.set('radio', value);
- this.changeset.save();
- }
-}
diff --git a/doc-app/app/controllers/docs/ember-input-validation/radio.js b/doc-app/app/controllers/docs/ember-input-validation/radio.js
deleted file mode 100644
index 80d9d72e..00000000
--- a/doc-app/app/controllers/docs/ember-input-validation/radio.js
+++ /dev/null
@@ -1,30 +0,0 @@
-import Controller from '@ember/controller';
-import { action } from '@ember/object';
-import { tracked } from 'tracked-built-ins';
-import { ImmerChangeset } from 'ember-immer-changeset';
-
-export default class DocsRadioValidationController extends Controller {
- first = 'Ho yes!';
- second = 'It the good choice!';
- third = 'You don t regret it!';
-
- changeset = new ImmerChangeset({
- radio: undefined,
- });
-
- @action
- onChange(value) {
- this.changeset.set('radio', value);
- this.changeset.save();
- if (!this.changeset.get('radio')) {
- this.changeset.addError({
- message: 'Select a radio',
- value: true,
- originalValue: true,
- key: 'radio',
- });
- } else {
- this.changeset.removeError('radio');
- }
- }
-}
diff --git a/doc-app/app/controllers/docs/ember-input-validation/tpk-form.ts b/doc-app/app/controllers/docs/ember-input-validation/tpk-form.ts
deleted file mode 100644
index 532de48a..00000000
--- a/doc-app/app/controllers/docs/ember-input-validation/tpk-form.ts
+++ /dev/null
@@ -1,48 +0,0 @@
-import Controller from '@ember/controller';
-import ImmerChangeset from 'ember-immer-changeset';
-import { object, string, array, date, boolean, number } from 'yup';
-import { action } from '@ember/object';
-
-// BEGIN-SNIPPET tpk-form-controller.js
-export default class TpkFormController extends Controller {
- changeset = new ImmerChangeset({
- firstName: '',
- lastName: '',
- languages: ['French', 'English'],
- birthday: null,
- email: '',
- phone: '',
- nationalNumber: '',
- vat: '',
- bic: '',
- iban: '',
- status: '',
- isFree: false,
- time: null,
- availableMoney: 0,
- });
- options = ['French', 'English', 'Spanish', 'German', 'Italian'];
- validationSchema = object().shape({
- firstName: string().required().min(3),
- lastName: string().required().min(3),
- languages: array().min(2),
- birthday: date().required(),
- email: string().email().required(),
- phone: string().required(),
- nationalNumber: string().optional(),
- vat: string().optional(),
- bic: string().optional(),
- iban: string().optional(),
- status: string().optional(),
- isFree: boolean().required(),
- time: date().required(),
- password: string().required(),
- availableMoney: number().required(),
- });
-
- @action
- success() {
- alert('success');
- }
-}
-// END-SNIPPET
diff --git a/doc-app/app/controllers/docs/ember-input/button.ts b/doc-app/app/controllers/docs/ember-input/button.ts
deleted file mode 100644
index 554f7ab9..00000000
--- a/doc-app/app/controllers/docs/ember-input/button.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import Controller from '@ember/controller';
-import { action } from '@ember/object';
-import { tracked } from 'tracked-built-ins';
-
-export default class DocsTpkButtonController extends Controller {
- @tracked counter = 0;
-
- @action
- async incrementCounter() {
- await new Promise((resolve) => setTimeout(resolve, 1000));
- this.counter++;
- }
-}
diff --git a/doc-app/app/controllers/docs/ember-input/checkbox.ts b/doc-app/app/controllers/docs/ember-input/checkbox.ts
deleted file mode 100644
index 56132287..00000000
--- a/doc-app/app/controllers/docs/ember-input/checkbox.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import Controller from '@ember/controller';
-import { action } from '@ember/object';
-import { tracked } from 'tracked-built-ins';
-
-export default class DocsTpkCheckboxController extends Controller {
- @tracked checked = false;
-
- @action
- onChange(checked: boolean) {
- this.checked = checked;
- }
-}
diff --git a/doc-app/app/controllers/docs/ember-input/datepicker.ts b/doc-app/app/controllers/docs/ember-input/datepicker.ts
deleted file mode 100644
index 328e802e..00000000
--- a/doc-app/app/controllers/docs/ember-input/datepicker.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import Controller from '@ember/controller';
-import { action } from '@ember/object';
-import { tracked } from 'tracked-built-ins';
-
-export default class DocsTpkDatepickerController extends Controller {
- @tracked selectedDate?: Date;
- @tracked selectedDates?: Date[];
- @tracked date = new Date(2022, 10, 15);
- @tracked minDate = new Date(2022, 10, 13);
- @tracked maxDate = new Date(2022, 10, 16);
-
- @action
- onChange(dates: [Date, Date]) {
- this.selectedDate = dates[0];
- }
-
- @action
- onChangeRange(dates: [Date, Date]) {
- this.selectedDates = dates;
- }
-}
diff --git a/doc-app/app/controllers/docs/ember-input/file.ts b/doc-app/app/controllers/docs/ember-input/file.ts
deleted file mode 100644
index caa77d9d..00000000
--- a/doc-app/app/controllers/docs/ember-input/file.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import Controller from '@ember/controller';
-import { action } from '@ember/object';
-import { tracked } from 'tracked-built-ins';
-
-export default class DocsTpkFileController extends Controller {
- @tracked value?: File;
-
- @action
- onChange(value: File) {
- this.value = value;
- }
-}
diff --git a/doc-app/app/controllers/docs/ember-input/input.ts b/doc-app/app/controllers/docs/ember-input/input.ts
deleted file mode 100644
index 819459e5..00000000
--- a/doc-app/app/controllers/docs/ember-input/input.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import Controller from '@ember/controller';
-import { action } from '@ember/object';
-import { tracked } from 'tracked-built-ins';
-
-export default class DocsTpkInputController extends Controller {
- @tracked value: string | undefined = undefined;
-
- @action
- onChange(value: string) {
- this.value = value;
- }
-}
diff --git a/doc-app/app/controllers/docs/ember-input/prefabs/button.ts b/doc-app/app/controllers/docs/ember-input/prefabs/button.ts
deleted file mode 100644
index cb640c9b..00000000
--- a/doc-app/app/controllers/docs/ember-input/prefabs/button.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import Controller from '@ember/controller';
-import { action } from '@ember/object';
-import { tracked } from 'tracked-built-ins';
-
-export default class DocsTpkPrefabButtonController extends Controller {
- @tracked counter = 0;
-
- @action
- async incrementCounter() {
- this.counter++;
- }
-}
\ No newline at end of file
diff --git a/doc-app/app/controllers/docs/ember-input/prefabs/toggle.ts b/doc-app/app/controllers/docs/ember-input/prefabs/toggle.ts
deleted file mode 100644
index e6c2655f..00000000
--- a/doc-app/app/controllers/docs/ember-input/prefabs/toggle.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import Controller from "@ember/controller";
-
-export default class extends Controller {}
diff --git a/doc-app/app/controllers/docs/ember-input/radio.ts b/doc-app/app/controllers/docs/ember-input/radio.ts
deleted file mode 100644
index 4414adcc..00000000
--- a/doc-app/app/controllers/docs/ember-input/radio.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import Controller from '@ember/controller';
-import { action } from '@ember/object';
-import { tracked } from 'tracked-built-ins';
-
-export default class DocsTpkInputController extends Controller {
- @tracked value = '';
-
- @action
- setRadio(value: string) {
- this.value = value;
- }
-}
diff --git a/doc-app/app/controllers/docs/ember-input/select.ts b/doc-app/app/controllers/docs/ember-input/select.ts
deleted file mode 100644
index bc2bba0f..00000000
--- a/doc-app/app/controllers/docs/ember-input/select.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-import Controller from '@ember/controller';
-import { action } from '@ember/object';
-import { tracked } from 'tracked-built-ins';
-
-export default class DocsTpkSelectController extends Controller {
- @tracked selection = '';
- @tracked valueCar: string[] = [];
- @tracked multiple = true;
- @tracked sauceOptions = ['BBQ', 'Ketchup', 'Dallas'];
- @tracked carOptions = ['BMW', 'Mercedes', 'Audi', 'Tesla'];
-
- @action
- onChange(value: string) {
- this.selection = value;
- }
-
- @action
- onChangeCar(car: string) {
- if (this.valueCar.includes(car)) {
- this.valueCar = this.valueCar.filter(
- (existingCar) => existingCar !== car,
- );
- } else {
- this.valueCar = [...this.valueCar, car];
- }
- }
-}
diff --git a/doc-app/app/controllers/docs/ember-input/textarea.ts b/doc-app/app/controllers/docs/ember-input/textarea.ts
deleted file mode 100644
index d68b49dc..00000000
--- a/doc-app/app/controllers/docs/ember-input/textarea.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import Controller from '@ember/controller';
-import { action } from '@ember/object';
-import { tracked } from 'tracked-built-ins';
-
-export default class DocsTpkCheckboxController extends Controller {
- @tracked value =
- `Tomster was the first of many friendly faces of the Ember project and community... Read more at https://emberjs.com/mascots/`;
-
- @action
- onChange(value: string) {
- this.value = value;
- }
-}
diff --git a/doc-app/app/controllers/docs/ember-ui/actions-menu.ts b/doc-app/app/controllers/docs/ember-ui/actions-menu.ts
deleted file mode 100644
index a8b12ce1..00000000
--- a/doc-app/app/controllers/docs/ember-ui/actions-menu.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import Controller from '@ember/controller';
-import { action } from '@ember/object';
-
-export default class DocsActionsMenuController extends Controller {
- @action
- showEditPopup() {
- window.alert('Edit');
- }
-}
diff --git a/doc-app/app/controllers/docs/ember-ui/modal.ts b/doc-app/app/controllers/docs/ember-ui/modal.ts
deleted file mode 100644
index dc143aeb..00000000
--- a/doc-app/app/controllers/docs/ember-ui/modal.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import Controller from '@ember/controller';
-import { action } from '@ember/object';
-import { tracked } from 'tracked-built-ins';
-
-export default class DocsModalController extends Controller {
- @tracked isOpen = false;
- @tracked title = 'Modal title';
-
- @action
- open() {
- this.isOpen = true;
- }
-
- @action
- onClose() {
- this.isOpen = false;
- }
-}
diff --git a/doc-app/app/controllers/docs/ember-ui/prefabs/confirm-modal.ts b/doc-app/app/controllers/docs/ember-ui/prefabs/confirm-modal.ts
deleted file mode 100644
index a8185b95..00000000
--- a/doc-app/app/controllers/docs/ember-ui/prefabs/confirm-modal.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-import Controller from '@ember/controller';
-import { action } from '@ember/object';
-import { tracked } from 'tracked-built-ins';
-
-export default class DocsTpkConfirmModalPrefabController extends Controller {
- @tracked isOpen = false;
- confirmQuestion = 'Are you sure?';
- confirmText = 'Yes';
- cancelText = 'No';
-
- @action
- open() {
- this.isOpen = true;
- }
-
- @action
- onClose() {
- this.isOpen = false;
- }
-
- @action
- onConfirm() {
- this.isOpen = false;
- alert('Confirmed');
- }
-
-}
\ No newline at end of file
diff --git a/doc-app/app/controllers/docs/ember-ui/prefabs/table-generic.ts b/doc-app/app/controllers/docs/ember-ui/prefabs/table-generic.ts
deleted file mode 100644
index 5ee52c53..00000000
--- a/doc-app/app/controllers/docs/ember-ui/prefabs/table-generic.ts
+++ /dev/null
@@ -1,46 +0,0 @@
-import Controller from "@ember/controller";
-import { action } from "@ember/object";
-
-
-
-export default class DocsTpkTableGenericPrefabController extends Controller {
-
-// BEGIN-SNIPPET tpk-table-generic-prefab.js
- tableParams:any = {
- entity: 'user',
- pageSizes: [10,30,50,75],
- defaultSortColumn: 'firstName',
- rowClick(element: any){
- alert(`row clicked ${element.id}`);
- },
- columns:[
- {
- field: 'lastName',
- headerName: 'Nom',
- sortable: true,
- },
- {
- field: 'firstName',
- headerName: 'Prénom',
- sortable: true,
- },
- {
- field: 'email',
- headerName: 'Email',
- sortable: false,
- }],
- actionMenu: [{
- icon: 'edit',
- action: (element:any) => {alert(`edit action ${element.id}`);
- },
- name: 'Edit',
- },
- {
- icon: 'delete',
- action: () => {alert('delete action')},
- name: 'Delete',
- }],
- };
-
-// END-SNIPPET
-}
\ No newline at end of file
diff --git a/doc-app/app/controllers/docs/ember-ui/stack-list.ts b/doc-app/app/controllers/docs/ember-ui/stack-list.ts
deleted file mode 100644
index 6d59e792..00000000
--- a/doc-app/app/controllers/docs/ember-ui/stack-list.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import Controller from '@ember/controller';
-import { action } from '@ember/object';
-import { tracked } from 'tracked-built-ins';
-
-export default class DocsStackListController extends Controller {
- @tracked data: string[] = [];
- titleForAdd = 'add element to list';
- contentData = 'element added';
-
- @action
- onAddData() {
- const newData = [...this.data, this.contentData];
- this.data = newData;
- }
-
- @action
- onRemoveData(index: number) {
- const newData = [...this.data];
- newData.splice(index, 1);
- this.data = newData;
- }
-}
diff --git a/doc-app/app/controllers/docs/ember-ui/table-generic.ts b/doc-app/app/controllers/docs/ember-ui/table-generic.ts
deleted file mode 100644
index 037a8388..00000000
--- a/doc-app/app/controllers/docs/ember-ui/table-generic.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import Controller from '@ember/controller';
-import { action } from '@ember/object';
-import { tracked } from 'tracked-built-ins';
-
-export default class DocsTableGenericController extends Controller {
- @action
- rowClick() {
- alert('row click');
- }
-
- @tracked pageSizes = [10, 25, 50, 100];
- @tracked pageSize = 10;
-
- @action
- deleteAction() {
- alert('delete click');
- }
-}
diff --git a/doc-app/app/deprecation-workflow.ts b/doc-app/app/deprecation-workflow.ts
new file mode 100644
index 00000000..274a689d
--- /dev/null
+++ b/doc-app/app/deprecation-workflow.ts
@@ -0,0 +1,24 @@
+import setupDeprecationWorkflow from 'ember-cli-deprecation-workflow';
+
+/**
+ * Docs: https://github.com/ember-cli/ember-cli-deprecation-workflow
+ */
+setupDeprecationWorkflow({
+ /**
+ false by default, but if a developer / team wants to be more aggressive about being proactive with
+ handling their deprecations, this should be set to "true"
+ */
+ throwOnUnhandled: false,
+ workflow: [
+ /* ... handlers ... */
+ /* to generate this list, run your app for a while (or run the test suite),
+ * and then run in the browser console:
+ *
+ * deprecationWorkflow.flushDeprecations()
+ *
+ * And copy the handlers here
+ */
+ /* example: */
+ /* { handler: 'silence', matchId: 'template-action' }, */
+ ],
+});
diff --git a/doc-app/app/formats.js b/doc-app/app/formats.js
deleted file mode 100644
index 098504a0..00000000
--- a/doc-app/app/formats.js
+++ /dev/null
@@ -1,29 +0,0 @@
-export default {
- time: {
- hhmmss: {
- hour: 'numeric',
- minute: 'numeric',
- second: 'numeric',
- },
- },
- date: {
- hhmmss: {
- hour: 'numeric',
- minute: 'numeric',
- second: 'numeric',
- },
- },
- number: {
- compact: {
- notation: 'compact',
- },
- EUR: {
- style: 'currency',
- currency: 'EUR',
- },
- USD: {
- style: 'currency',
- currency: 'USD',
- },
- },
-};
diff --git a/doc-app/app/helpers/catch-state.ts b/doc-app/app/helpers/catch-state.ts
index bf7cc7b9..cd63d923 100644
--- a/doc-app/app/helpers/catch-state.ts
+++ b/doc-app/app/helpers/catch-state.ts
@@ -2,10 +2,14 @@ import Helper from '@ember/component/helper';
import { service } from '@ember/service';
import CatchState from '../services/catch-state';
-export default class Substring extends Helper {
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
+export default class CatchStateHelper extends Helper {
@service declare catchState: CatchState;
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
compute([state]: [any]) {
this.catchState.state = state;
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-return
+ return state;
}
}
diff --git a/doc-app/app/helpers/to-string.ts b/doc-app/app/helpers/to-string.ts
new file mode 100644
index 00000000..3875b1de
--- /dev/null
+++ b/doc-app/app/helpers/to-string.ts
@@ -0,0 +1,3 @@
+export default function stringify(value: unknown) {
+ return String(value);
+}
diff --git a/doc-app/app/models/user.ts b/doc-app/app/models/user.ts
index 7860c78a..3b4b064d 100644
--- a/doc-app/app/models/user.ts
+++ b/doc-app/app/models/user.ts
@@ -1,10 +1,28 @@
-import Model, { attr } from '@ember-data/model';
+import {
+ withDefaults,
+ type WithLegacy,
+} from '@warp-drive/legacy/model/migration-support';
+import { Type } from '@warp-drive/core/types/symbols';
-export default class UserModel extends Model {
- @attr('string') email!: string;
- @attr('string') firstName!: string;
- @attr('string') lastName!: string;
- @attr('string') phone!: string;
- @attr('string') job!: string;
- @attr('string') country!: string;
-}
+export const UserSchema = withDefaults({
+ type: 'user',
+ fields: [
+ { name: 'email', kind: 'attribute' },
+ { name: 'firstName', kind: 'attribute' },
+ { name: 'lastName', kind: 'attribute' },
+ { name: 'phone', kind: 'attribute' },
+ { name: 'job', kind: 'attribute' },
+ { name: 'country', kind: 'attribute' },
+ ],
+});
+
+export type User = WithLegacy<{
+ firstName: string;
+ lastName: string;
+ age: number;
+ email: string;
+ phone: string;
+ job: string;
+ country: string;
+ [Type]: 'user';
+}>;
diff --git a/doc-app/app/router.ts b/doc-app/app/router.ts
index afbdbdd4..5febaa86 100644
--- a/doc-app/app/router.ts
+++ b/doc-app/app/router.ts
@@ -1,80 +1,60 @@
-// @ts-expect-error no types
-import AddonDocsRouter, { docsRoute } from 'ember-cli-addon-docs/router';
-import config from './config/environment';
-import RouterDSL from '@ember/routing/-private/router-dsl';
+import EmberRouter from '@embroider/router';
+import config from 'doc-app/config/environment';
+import '@warp-drive/ember/install';
-const Router = AddonDocsRouter.extend({
- location: config.locationType,
- rootURL: config.rootURL,
-});
+export default class Router extends EmberRouter {
+ location = config.locationType;
+ rootURL = config.rootURL;
+}
-Router.map(function (this: RouterDSL) {
- docsRoute(this, function (this: RouterDSL) {
- this.route('ember-ui', function (this: RouterDSL) {
- this.route('prefabs', function () {
- this.route('confirm-modal')
- this.route('table-generic')
- })
- this.route('installation');
- this.route('actions-menu');
- this.route('modal');
- this.route('table-generic');
- this.route('file-list');
- this.route('stack-list');
- });
- this.route('ember-input', function () {
- this.route('installation');
- this.route('prefabs', function () {
- this.route('button')
- this.route('toggle');
+Router.map(function () {
+ this.route('dashboard', { path: '/' }, function () {
+ this.route('docs', function () {
+ this.route('ember-input-validation', function () {
+ this.route('prefabs', function () {
+ this.route('input');
+ this.route('number');
+ this.route('bic');
+ this.route('currency');
+ this.route('datepicker-range');
+ this.route('datepicker');
+ this.route('email');
+ this.route('file');
+ this.route('file-list');
+ this.route('iban');
+ this.route('integer');
+ this.route('mobile');
+ this.route('national-number');
+ this.route('password');
+ this.route('radio');
+ this.route('radio-group');
+ this.route('select');
+ this.route('select-create');
+ this.route('select-search');
+ this.route('textarea');
+ this.route('timepicker');
+ this.route('vat');
+ });
});
- this.route('input');
- this.route('button');
- this.route('checkbox');
- this.route('datepicker');
- this.route('file');
- this.route('radio');
- this.route('select');
- this.route('select-search');
- this.route('textarea');
- });
- this.route('ember-input-validation', function () {
- this.route('prefabs', function () {
- this.route('input');
- this.route('textarea');
- this.route('checkbox');
- this.route('radio');
- this.route('radio-group');
- this.route('password');
- this.route('mobile');
- this.route('iban');
- this.route('bic');
- this.route('currency');
- this.route('select-search');
- this.route('vat');
- this.route('email');
- this.route('national-number');
- this.route('select');
- this.route('select-create');
- this.route('integer');
- this.route('number');
- this.route('timepicker');
- this.route('datepicker');
- this.route('datepicker-range');
- this.route('file');
- this.route('file-list');
+
+ this.route('ember-input', function () {
+ this.route('prefabs', function () {
+ this.route('button');
+ this.route('toggle');
+ });
+ });
+
+ this.route('ember-ui', function () {
+ this.route('prefabs', function () {
+ this.route('confirm-modal');
+ this.route('table-generic');
+ this.route('tpk-form');
+ });
});
- this.route('installation');
- this.route('checkbox');
- this.route('datepicker');
- this.route('file');
- this.route('input');
- this.route('radio-group');
- this.route('select');
- this.route('textarea');
- this.route('tpk-form');
});
});
+ this.route('home', function () {});
+ this.route('login', function () {});
+ this.route('forgot-password', function () {});
+ this.route('reset-password', function () {});
});
-
-export default Router;
diff --git a/doc-app/app/routes/application.ts b/doc-app/app/routes/application.ts
index 21ec19cc..eb73d9a3 100644
--- a/doc-app/app/routes/application.ts
+++ b/doc-app/app/routes/application.ts
@@ -1,52 +1,17 @@
+/* app/routes/application.ts */
import Route from '@ember/routing/route';
-import { service } from '@ember/service';
-import config from 'doc-app/config/environment';
-import type { IntlService } from 'ember-intl';
-import { rest } from 'msw';
+import { type Registry as Services, service } from '@ember/service';
+import translationsForEnUs from 'virtual:ember-intl/translations/en-us';
export default class ApplicationRoute extends Route {
- @service intl!: IntlService;
+ @service declare intl: Services['intl'];
- async beforeModel() {
+ beforeModel(): void {
+ this.setupIntl();
+ }
+
+ private setupIntl(): void {
+ this.intl.addTranslations('en-us', translationsForEnUs);
this.intl.setLocale(['en-us']);
- // @ts-expect-error no types available for worker
- const { worker } = await import('/worker.js');
- await worker([
- rest.get('/users', (req, res, ctx) => {
- return res(
- ctx.status(200),
- ctx.json({
- meta: {
- total: 1,
- page: 1,
- },
- data: [
- {
- type: 'user',
- id: '1-john',
- attributes: {
- firstName: 'John',
- lastName: 'Doe',
- email: 'john.doe@example.com',
- },
- },
- {
- type: 'user',
- id: '2',
- attributes: {
- firstName: 'Jack',
- lastName: 'Lime',
- email: 'jack.lime@example.com',
- },
- },
- ],
- }),
- );
- }),
- ]).start({
- serviceWorker: {
- url: `${config.rootURL}mockServiceWorker.js`,
- },
- });
}
}
diff --git a/doc-app/app/routes/dashboard.ts b/doc-app/app/routes/dashboard.ts
new file mode 100644
index 00000000..c365d166
--- /dev/null
+++ b/doc-app/app/routes/dashboard.ts
@@ -0,0 +1,6 @@
+/* app/routes/application.ts */
+import Route from '@ember/routing/route';
+
+export default class DashboardRoute extends Route {
+ beforeModel(): void {}
+}
diff --git a/doc-app/app/routes/dashboard/docs.ts b/doc-app/app/routes/dashboard/docs.ts
new file mode 100644
index 00000000..fc9dbeb7
--- /dev/null
+++ b/doc-app/app/routes/dashboard/docs.ts
@@ -0,0 +1,3 @@
+import Route from '@ember/routing/route';
+
+export default class DashboardDocsRoute extends Route {}
diff --git a/doc-app/app/routes/dashboard/docs/ember-input-validation.ts b/doc-app/app/routes/dashboard/docs/ember-input-validation.ts
new file mode 100644
index 00000000..fb7ea4f1
--- /dev/null
+++ b/doc-app/app/routes/dashboard/docs/ember-input-validation.ts
@@ -0,0 +1,3 @@
+import Route from '@ember/routing/route';
+
+export default class DashboardDocsEmberInputValidationRoute extends Route {}
diff --git a/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs.ts b/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs.ts
new file mode 100644
index 00000000..072a68fc
--- /dev/null
+++ b/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs.ts
@@ -0,0 +1,3 @@
+import Route from '@ember/routing/route';
+
+export default class DashboardDocsEmberInputValidationPrefabsRoute extends Route {}
diff --git a/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/bic.ts b/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/bic.ts
new file mode 100644
index 00000000..ff88f348
--- /dev/null
+++ b/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/bic.ts
@@ -0,0 +1,66 @@
+import Route from '@ember/routing/route';
+
+export default class DocsEmberInputValidationPrefabsBicRoute extends Route {
+ model() {
+ return {
+ properties: [
+ {
+ name: '@validationField',
+ type: 'string',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.bic.properties.validationField.description',
+ },
+ {
+ name: '@changeset',
+ type: 'ImmerChangeset',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.bic.properties.changeset.description',
+ },
+ {
+ name: '@label',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.bic.properties.label.description',
+ },
+ {
+ name: '@placeholder',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.bic.properties.placeholder.description',
+ },
+ {
+ name: '@mandatory',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.bic.properties.mandatory.description',
+ },
+ {
+ name: '@disabled',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.bic.properties.disabled.description',
+ },
+ {
+ name: '@onChange',
+ type: 'function',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.bic.properties.onChange.description',
+ },
+ {
+ name: '@changeEvent',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.bic.properties.changeEvent.description',
+ },
+ ],
+ };
+ }
+}
diff --git a/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/currency.ts b/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/currency.ts
new file mode 100644
index 00000000..5255ffeb
--- /dev/null
+++ b/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/currency.ts
@@ -0,0 +1,66 @@
+import Route from '@ember/routing/route';
+
+export default class DocsEmberInputValidationPrefabsCurrencyRoute extends Route {
+ model() {
+ return {
+ properties: [
+ {
+ name: '@validationField',
+ type: 'string',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.currency.properties.validationField.description',
+ },
+ {
+ name: '@changeset',
+ type: 'ImmerChangeset',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.currency.properties.changeset.description',
+ },
+ {
+ name: '@label',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.currency.properties.label.description',
+ },
+ {
+ name: '@placeholder',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.currency.properties.placeholder.description',
+ },
+ {
+ name: '@disabled',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.currency.properties.disabled.description',
+ },
+ {
+ name: '@mandatory',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.currency.properties.mandatory.description',
+ },
+ {
+ name: '@onChange',
+ type: 'function',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.currency.properties.onChange.description',
+ },
+ {
+ name: '@changeEvent',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.currency.properties.changeEvent.description',
+ },
+ ],
+ };
+ }
+}
diff --git a/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/datepicker-range.ts b/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/datepicker-range.ts
new file mode 100644
index 00000000..87997d50
--- /dev/null
+++ b/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/datepicker-range.ts
@@ -0,0 +1,150 @@
+import Route from '@ember/routing/route';
+
+export default class DocsEmberInputValidationPrefabsDatepickerRangeRoute extends Route {
+ model() {
+ return {
+ properties: [
+ {
+ name: '@validationField',
+ type: 'string',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.datepicker-range.properties.validationField.description',
+ },
+ {
+ name: '@changeset',
+ type: 'ImmerChangeset',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.datepicker-range.properties.changeset.description',
+ },
+ {
+ name: '@multipleDatesSeparator',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.datepicker-range.properties.multipleDatesSeparator.description',
+ },
+ {
+ name: '@label',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.datepicker-range.properties.label.description',
+ },
+ {
+ name: '@onChange',
+ type: 'function',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.datepicker-range.properties.onChange.description',
+ },
+ {
+ name: '@onClose',
+ type: 'function',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.datepicker-range.properties.onClose.description',
+ },
+ {
+ name: '@disabled',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.datepicker-range.properties.disabled.description',
+ },
+ {
+ name: '@mandatory',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.datepicker-range.properties.mandatory.description',
+ },
+ {
+ name: '@placeholder',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.datepicker-range.properties.placeholder.description',
+ },
+ {
+ name: '@clearButton',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.datepicker-range.properties.clearButton.description',
+ },
+ {
+ name: '@todayButton',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.datepicker-range.properties.todayButton.description',
+ },
+ {
+ name: '@closeButton',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.datepicker-range.properties.closeButton.description',
+ },
+ {
+ name: '@minDate',
+ type: 'Date',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.datepicker-range.properties.minDate.description',
+ },
+ {
+ name: '@maxDate',
+ type: 'Date',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.datepicker-range.properties.maxDate.description',
+ },
+ {
+ name: '@keepOpen',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.datepicker-range.properties.keepOpen.description',
+ },
+ {
+ name: '@daysOfWeekDisabled',
+ type: 'number[]',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.datepicker-range.properties.daysOfWeekDisabled.description',
+ },
+ {
+ name: '@disabledDates',
+ type: 'Date[]',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.datepicker-range.properties.disabledDates.description',
+ },
+ {
+ name: '@viewMode',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.datepicker-range.properties.viewMode.description',
+ },
+ {
+ name: '@locale',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.datepicker-range.properties.locale.description',
+ },
+ {
+ name: '@dateFormat',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.datepicker-range.properties.dateFormat.description',
+ },
+ ],
+ };
+ }
+}
diff --git a/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/datepicker.ts b/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/datepicker.ts
new file mode 100644
index 00000000..409826e8
--- /dev/null
+++ b/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/datepicker.ts
@@ -0,0 +1,207 @@
+// doc-app/app/routes/docs/ember-input-validation/prefabs/datepicker.ts
+import Route from '@ember/routing/route';
+
+export default class DocsEmberInputValidationPrefabsDatepickerRoute extends Route {
+ model() {
+ return {
+ properties: [
+ {
+ name: '@validationField',
+ type: 'string',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.datepicker.properties.validationField.description',
+ },
+ {
+ name: '@changeset',
+ type: 'ImmerChangeset',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.datepicker.properties.changeset.description',
+ },
+ {
+ name: '@multipleDatesSeparator',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.datepicker.properties.multipleDatesSeparator.description',
+ },
+ {
+ name: '@label',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.datepicker.properties.label.description',
+ },
+ {
+ name: '@onChange',
+ type: 'function',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.datepicker.properties.onChange.description',
+ },
+ {
+ name: '@onClose',
+ type: 'function',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.datepicker.properties.onClose.description',
+ },
+ {
+ name: '@disabled',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.datepicker.properties.disabled.description',
+ },
+ {
+ name: '@mandatory',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.datepicker.properties.mandatory.description',
+ },
+ {
+ name: '@placeholder',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.datepicker.properties.placeholder.description',
+ },
+ {
+ name: '@clearButton',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.datepicker.properties.clearButton.description',
+ },
+ {
+ name: '@todayButton',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.datepicker.properties.todayButton.description',
+ },
+ {
+ name: '@closeButton',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.datepicker.properties.closeButton.description',
+ },
+ {
+ name: '@minDate',
+ type: 'Date',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.datepicker.properties.minDate.description',
+ },
+ {
+ name: '@maxDate',
+ type: 'Date',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.datepicker.properties.maxDate.description',
+ },
+ {
+ name: '@keepOpen',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.datepicker.properties.keepOpen.description',
+ },
+ {
+ name: '@daysOfWeekDisabled',
+ type: 'Array',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.datepicker.properties.daysOfWeekDisabled.description',
+ },
+ {
+ name: '@disabledDates',
+ type: 'Array',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.datepicker.properties.disabledDates.description',
+ },
+ {
+ name: '@viewMode',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.datepicker.properties.viewMode.description',
+ },
+ {
+ name: '@locale',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.datepicker.properties.locale.description',
+ },
+ {
+ name: '@dateFormat',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.datepicker.properties.dateFormat.description',
+ },
+ {
+ name: '@promptTimeOnDateChange',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.datepicker.properties.promptTimeOnDateChange.description',
+ },
+ {
+ name: '@noCalendar',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.datepicker.properties.noCalendar.description',
+ },
+ {
+ name: '@enableTime',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.datepicker.properties.enableTime.description',
+ },
+ {
+ name: '@stepping',
+ type: 'number',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.datepicker.properties.stepping.description',
+ },
+ {
+ name: '@enableSecond',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.datepicker.properties.enableSecond.description',
+ },
+ {
+ name: '@disabledTimeIntervals',
+ type: 'Array',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.datepicker.properties.disabledTimeIntervals.description',
+ },
+ {
+ name: '@disabledHours',
+ type: 'Array',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.datepicker.properties.disabledHours.description',
+ },
+ {
+ name: '@enabledHours',
+ type: 'Array',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.datepicker.properties.enabledHours.description',
+ },
+ ],
+ };
+ }
+}
diff --git a/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/email.ts b/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/email.ts
new file mode 100644
index 00000000..de9adb61
--- /dev/null
+++ b/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/email.ts
@@ -0,0 +1,67 @@
+// doc-app/app/routes/docs/ember-input-validation/prefabs/email.ts
+import Route from '@ember/routing/route';
+
+export default class DocsEmberInputValidationPrefabsEmailRoute extends Route {
+ model() {
+ return {
+ properties: [
+ {
+ name: '@validationField',
+ type: 'string',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.email.properties.validationField.description',
+ },
+ {
+ name: '@changeset',
+ type: 'ImmerChangeset',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.email.properties.changeset.description',
+ },
+ {
+ name: '@label',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.email.properties.label.description',
+ },
+ {
+ name: '@placeholder',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.email.properties.placeholder.description',
+ },
+ {
+ name: '@disabled',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.email.properties.disabled.description',
+ },
+ {
+ name: '@mandatory',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.email.properties.mandatory.description',
+ },
+ {
+ name: '@onChange',
+ type: 'function',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.email.properties.onChange.description',
+ },
+ {
+ name: '@changeEvent',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.email.properties.changeEvent.description',
+ },
+ ],
+ };
+ }
+}
diff --git a/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/file-list.ts b/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/file-list.ts
new file mode 100644
index 00000000..c5385c6b
--- /dev/null
+++ b/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/file-list.ts
@@ -0,0 +1,67 @@
+// doc-app/app/routes/docs/ember-input-validation/prefabs/file-list.ts
+import Route from '@ember/routing/route';
+
+export default class DocsEmberInputValidationPrefabsFileListRoute extends Route {
+ model() {
+ return {
+ properties: [
+ {
+ name: '@validationField',
+ type: 'string',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.file-list.properties.validationField.description',
+ },
+ {
+ name: '@changeset',
+ type: 'ImmerChangeset',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.file-list.properties.changeset.description',
+ },
+ {
+ name: '@label',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.file-list.properties.label.description',
+ },
+ {
+ name: '@placeholder',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.file-list.properties.placeholder.description',
+ },
+ {
+ name: '@disabled',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.file-list.properties.disabled.description',
+ },
+ {
+ name: '@mandatory',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.file-list.properties.mandatory.description',
+ },
+ {
+ name: '@onChange',
+ type: 'function',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.file-list.properties.onChange.description',
+ },
+ {
+ name: '@disableDownload',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.file-list.properties.disableDownload.description',
+ },
+ ],
+ };
+ }
+}
diff --git a/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/file.ts b/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/file.ts
new file mode 100644
index 00000000..9fd1c939
--- /dev/null
+++ b/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/file.ts
@@ -0,0 +1,60 @@
+// doc-app/app/routes/docs/ember-input-validation/prefabs/file.ts
+import Route from '@ember/routing/route';
+
+export default class DocsEmberInputValidationPrefabsFileRoute extends Route {
+ model() {
+ return {
+ properties: [
+ {
+ name: '@validationField',
+ type: 'string',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.file.properties.validationField.description',
+ },
+ {
+ name: '@changeset',
+ type: 'ImmerChangeset',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.file.properties.changeset.description',
+ },
+ {
+ name: '@label',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.file.properties.label.description',
+ },
+ {
+ name: '@disabled',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.file.properties.disabled.description',
+ },
+ {
+ name: '@mandatory',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.file.properties.mandatory.description',
+ },
+ {
+ name: '@onChange',
+ type: 'function',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.file.properties.onChange.description',
+ },
+ {
+ name: '@changeEvent',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.file.properties.changeEvent.description',
+ },
+ ],
+ };
+ }
+}
diff --git a/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/iban.ts b/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/iban.ts
new file mode 100644
index 00000000..3df00f01
--- /dev/null
+++ b/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/iban.ts
@@ -0,0 +1,67 @@
+// doc-app/app/routes/docs/ember-input-validation/prefabs/iban.ts
+import Route from '@ember/routing/route';
+
+export default class DocsEmberInputValidationPrefabsIbanRoute extends Route {
+ model() {
+ return {
+ properties: [
+ {
+ name: '@validationField',
+ type: 'string',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.iban.properties.validationField.description',
+ },
+ {
+ name: '@changeset',
+ type: 'ImmerChangeset',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.iban.properties.changeset.description',
+ },
+ {
+ name: '@label',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.iban.properties.label.description',
+ },
+ {
+ name: '@placeholder',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.iban.properties.placeholder.description',
+ },
+ {
+ name: '@disabled',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.iban.properties.disabled.description',
+ },
+ {
+ name: '@mandatory',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.iban.properties.mandatory.description',
+ },
+ {
+ name: '@onChange',
+ type: 'function',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.iban.properties.onChange.description',
+ },
+ {
+ name: '@changeEvent',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.iban.properties.changeEvent.description',
+ },
+ ],
+ };
+ }
+}
diff --git a/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/input.ts b/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/input.ts
new file mode 100644
index 00000000..7352d746
--- /dev/null
+++ b/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/input.ts
@@ -0,0 +1,95 @@
+// doc-app/app/routes/docs/ember-input-validation/prefabs/input.ts
+import Route from '@ember/routing/route';
+
+export default class DocsEmberInputValidationPrefabsInputRoute extends Route {
+ model() {
+ return {
+ properties: [
+ {
+ name: '@validationField',
+ type: 'string',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.input.properties.validationField.description',
+ },
+ {
+ name: '@changeset',
+ type: 'ImmerChangeset',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.input.properties.changeset.description',
+ },
+ {
+ name: '@label',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.input.properties.label.description',
+ },
+ {
+ name: '@placeholder',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.input.properties.placeholder.description',
+ },
+ {
+ name: '@type',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.input.properties.type.description',
+ },
+ {
+ name: '@mandatory',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.input.properties.mandatory.description',
+ },
+ {
+ name: '@mask',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.input.properties.mask.description',
+ },
+ {
+ name: '@maskOptions',
+ type: 'object',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.input.properties.maskOptions.description',
+ },
+ {
+ name: '@unmaskValue',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.input.properties.unmaskValue.description',
+ },
+ {
+ name: '@disabled',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.input.properties.disabled.description',
+ },
+ {
+ name: '@onChange',
+ type: 'function',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.input.properties.onChange.description',
+ },
+ {
+ name: '@changeEvent',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.input.properties.changeEvent.description',
+ },
+ ],
+ };
+ }
+}
diff --git a/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/integer.ts b/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/integer.ts
new file mode 100644
index 00000000..25062130
--- /dev/null
+++ b/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/integer.ts
@@ -0,0 +1,74 @@
+// doc-app/app/routes/docs/ember-input-validation/prefabs/integer.ts
+import Route from '@ember/routing/route';
+
+export default class DocsEmberInputValidationPrefabsIntegerRoute extends Route {
+ model() {
+ return {
+ properties: [
+ {
+ name: '@validationField',
+ type: 'string',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.integer.properties.validationField.description',
+ },
+ {
+ name: '@changeset',
+ type: 'ImmerChangeset',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.integer.properties.changeset.description',
+ },
+ {
+ name: '@label',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.integer.properties.label.description',
+ },
+ {
+ name: '@placeholder',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.integer.properties.placeholder.description',
+ },
+ {
+ name: '@disabled',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.integer.properties.disabled.description',
+ },
+ {
+ name: '@mandatory',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.integer.properties.mandatory.description',
+ },
+ {
+ name: '@onChange',
+ type: 'function',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.integer.properties.onChange.description',
+ },
+ {
+ name: '@changeEvent',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.integer.properties.changeEvent.description',
+ },
+ {
+ name: '@unsigned',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.integer.properties.unsigned.description',
+ },
+ ],
+ };
+ }
+}
diff --git a/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/mobile.ts b/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/mobile.ts
new file mode 100644
index 00000000..2071046b
--- /dev/null
+++ b/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/mobile.ts
@@ -0,0 +1,66 @@
+import Route from '@ember/routing/route';
+
+export default class DocsEmberInputValidationPrefabsMobileRoute extends Route {
+ model() {
+ return {
+ properties: [
+ {
+ name: '@validationField',
+ type: 'string',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.mobile.properties.validationField.description',
+ },
+ {
+ name: '@changeset',
+ type: 'ImmerChangeset',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.mobile.properties.changeset.description',
+ },
+ {
+ name: '@label',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.mobile.properties.label.description',
+ },
+ {
+ name: '@placeholder',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.mobile.properties.placeholder.description',
+ },
+ {
+ name: '@mandatory',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.mobile.properties.mandatory.description',
+ },
+ {
+ name: '@disabled',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.mobile.properties.disabled.description',
+ },
+ {
+ name: '@onChange',
+ type: 'function',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.mobile.properties.onChange.description',
+ },
+ {
+ name: '@changeEvent',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.mobile.properties.changeEvent.description',
+ },
+ ],
+ };
+ }
+}
diff --git a/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/national-number.ts b/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/national-number.ts
new file mode 100644
index 00000000..6431bb52
--- /dev/null
+++ b/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/national-number.ts
@@ -0,0 +1,66 @@
+import Route from '@ember/routing/route';
+
+export default class DocsEmberInputValidationPrefabsNationalNumberRoute extends Route {
+ model() {
+ return {
+ properties: [
+ {
+ name: '@validationField',
+ type: 'string',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.national-number.properties.validationField.description',
+ },
+ {
+ name: '@changeset',
+ type: 'ImmerChangeset',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.national-number.properties.changeset.description',
+ },
+ {
+ name: '@label',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.national-number.properties.label.description',
+ },
+ {
+ name: '@placeholder',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.national-number.properties.placeholder.description',
+ },
+ {
+ name: '@mandatory',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.national-number.properties.mandatory.description',
+ },
+ {
+ name: '@disabled',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.national-number.properties.disabled.description',
+ },
+ {
+ name: '@onChange',
+ type: 'function',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.national-number.properties.onChange.description',
+ },
+ {
+ name: '@changeEvent',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.national-number.properties.changeEvent.description',
+ },
+ ],
+ };
+ }
+}
diff --git a/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/number.ts b/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/number.ts
new file mode 100644
index 00000000..e0748de2
--- /dev/null
+++ b/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/number.ts
@@ -0,0 +1,95 @@
+// doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/number.ts
+import Route from '@ember/routing/route';
+
+export default class DocsEmberInputValidationPrefabsNumberRoute extends Route {
+ model() {
+ return {
+ properties: [
+ {
+ name: '@validationField',
+ type: 'string',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.number.properties.validationField.description',
+ },
+ {
+ name: '@changeset',
+ type: 'ImmerChangeset',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.number.properties.changeset.description',
+ },
+ {
+ name: '@label',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.number.properties.label.description',
+ },
+ {
+ name: '@placeholder',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.number.properties.placeholder.description',
+ },
+ {
+ name: '@unsigned',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.number.properties.unsigned.description',
+ },
+ {
+ name: '@min',
+ type: 'number',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.number.properties.min.description',
+ },
+ {
+ name: '@step',
+ type: 'number',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.number.properties.step.description',
+ },
+ {
+ name: '@mandatory',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.number.properties.mandatory.description',
+ },
+ {
+ name: '@disabled',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.number.properties.disabled.description',
+ },
+ {
+ name: '@onChange',
+ type: 'function',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.number.properties.onChange.description',
+ },
+ {
+ name: '@changeEvent',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.number.properties.changeEvent.description',
+ },
+ {
+ name: '@requiredFields',
+ type: 'string[]',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.number.properties.requiredFields.description',
+ },
+ ],
+ };
+ }
+}
diff --git a/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/password.ts b/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/password.ts
new file mode 100644
index 00000000..e44621c9
--- /dev/null
+++ b/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/password.ts
@@ -0,0 +1,66 @@
+import Route from '@ember/routing/route';
+
+export default class DocsEmberInputValidationPrefabsPasswordRoute extends Route {
+ model() {
+ return {
+ properties: [
+ {
+ name: '@validationField',
+ type: 'string',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.password.properties.validationField.description',
+ },
+ {
+ name: '@changeset',
+ type: 'ImmerChangeset',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.password.properties.changeset.description',
+ },
+ {
+ name: '@label',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.password.properties.label.description',
+ },
+ {
+ name: '@placeholder',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.password.properties.placeholder.description',
+ },
+ {
+ name: '@mandatory',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.password.properties.mandatory.description',
+ },
+ {
+ name: '@disabled',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.password.properties.disabled.description',
+ },
+ {
+ name: '@onChange',
+ type: 'function',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.password.properties.onChange.description',
+ },
+ {
+ name: '@changeEvent',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.password.properties.changeEvent.description',
+ },
+ ],
+ };
+ }
+}
diff --git a/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/radio-group.ts b/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/radio-group.ts
new file mode 100644
index 00000000..ff936f8f
--- /dev/null
+++ b/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/radio-group.ts
@@ -0,0 +1,66 @@
+import Route from '@ember/routing/route';
+
+export default class DocsEmberInputValidationPrefabsRadioGroupRoute extends Route {
+ model() {
+ return {
+ properties: [
+ {
+ name: '@validationField',
+ type: 'string',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.radio-group.properties.validationField.description',
+ },
+ {
+ name: '@changeset',
+ type: 'Changeset',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.radio-group.properties.changeset.description',
+ },
+ {
+ name: '@value',
+ type: 'string',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.radio-group.properties.value.description',
+ },
+ {
+ name: '@groupLabel',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.radio-group.properties.groupLabel.description',
+ },
+ {
+ name: '@mandatory',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.radio-group.properties.mandatory.description',
+ },
+ {
+ name: '@disabled',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.radio-group.properties.disabled.description',
+ },
+ {
+ name: '@classless',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.radio-group.properties.classless.description',
+ },
+ {
+ name: '@onChange',
+ type: 'function',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.radio-group.properties.onChange.description',
+ },
+ ],
+ };
+ }
+}
diff --git a/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/radio.ts b/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/radio.ts
new file mode 100644
index 00000000..56440ba3
--- /dev/null
+++ b/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/radio.ts
@@ -0,0 +1,66 @@
+import Route from '@ember/routing/route';
+
+export default class DocsEmberInputValidationPrefabsRadioRoute extends Route {
+ model() {
+ return {
+ properties: [
+ {
+ name: '@validationField',
+ type: 'string',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.radio.properties.validationField.description',
+ },
+ {
+ name: '@changeset',
+ type: 'Changeset',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.radio.properties.changeset.description',
+ },
+ {
+ name: '@value',
+ type: 'string',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.radio.properties.value.description',
+ },
+ {
+ name: '@label',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.radio.properties.label.description',
+ },
+ {
+ name: '@mandatory',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.radio.properties.mandatory.description',
+ },
+ {
+ name: '@disabled',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.radio.properties.disabled.description',
+ },
+ {
+ name: '@classless',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.radio.properties.classless.description',
+ },
+ {
+ name: '@onChange',
+ type: 'function',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.radio.properties.onChange.description',
+ },
+ ],
+ };
+ }
+}
diff --git a/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/select-create.ts b/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/select-create.ts
new file mode 100644
index 00000000..9d3db5f5
--- /dev/null
+++ b/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/select-create.ts
@@ -0,0 +1,164 @@
+import Route from '@ember/routing/route';
+
+export default class DocsEmberInputValidationPrefabsSelectCreateRoute extends Route {
+ model() {
+ return {
+ properties: [
+ {
+ name: '@validationField',
+ type: 'string',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.select-create.properties.validationField.description',
+ },
+ {
+ name: '@changeset',
+ type: 'Changeset',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.select-create.properties.changeset.description',
+ },
+ {
+ name: '@options',
+ type: 'Array',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.select-create.properties.options.description',
+ },
+ {
+ name: '@onCreate',
+ type: 'function',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.select-create.properties.onCreate.description',
+ },
+ {
+ name: '@label',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.select-create.properties.label.description',
+ },
+ {
+ name: '@placeholder',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.select-create.properties.placeholder.description',
+ },
+ {
+ name: '@disabled',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.select-create.properties.disabled.description',
+ },
+ {
+ name: '@multiple',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.select-create.properties.multiple.description',
+ },
+ {
+ name: '@initiallyOpened',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.select-create.properties.initiallyOpened.description',
+ },
+ {
+ name: '@allowClear',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.select-create.properties.allowClear.description',
+ },
+ {
+ name: '@mandatory',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.select-create.properties.mandatory.description',
+ },
+ {
+ name: '@onChange',
+ type: 'function',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.select-create.properties.onChange.description',
+ },
+ {
+ name: '@labelComponent',
+ type: 'Component',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.select-create.properties.labelComponent.description',
+ },
+ {
+ name: '@selectedItemComponent',
+ type: 'Component',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.select-create.properties.selectedItemComponent.description',
+ },
+ {
+ name: '@placeholderComponent',
+ type: 'Component',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.select-create.properties.placeholderComponent.description',
+ },
+ {
+ name: '@onSearch',
+ type: 'function',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.select-create.properties.onSearch.description',
+ },
+ {
+ name: '@searchPlaceholder',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.select-create.properties.searchPlaceholder.description',
+ },
+ {
+ name: '@searchMessage',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.select-create.properties.searchMessage.description',
+ },
+ {
+ name: '@loadingMessage',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.select-create.properties.loadingMessage.description',
+ },
+ {
+ name: '@noMatchesMessage',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.select-create.properties.noMatchesMessage.description',
+ },
+ {
+ name: '@showCreateWhen',
+ type: 'function',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.select-create.properties.showCreateWhen.description',
+ },
+ {
+ name: '@buildSuggestion',
+ type: 'function',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.select-create.properties.buildSuggestion.description',
+ },
+ ],
+ };
+ }
+}
diff --git a/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/select-search.ts b/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/select-search.ts
new file mode 100644
index 00000000..17b2dcf2
--- /dev/null
+++ b/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/select-search.ts
@@ -0,0 +1,143 @@
+import Route from '@ember/routing/route';
+
+export default class DocsEmberInputValidationPrefabsSelectSearchRoute extends Route {
+ model() {
+ return {
+ properties: [
+ {
+ name: '@validationField',
+ type: 'string',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.select-search.properties.validationField.description',
+ },
+ {
+ name: '@changeset',
+ type: 'Changeset',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.select-search.properties.changeset.description',
+ },
+ {
+ name: '@options',
+ type: 'Array',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.select-search.properties.options.description',
+ },
+ {
+ name: '@onSearch',
+ type: 'function',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.select-search.properties.onSearch.description',
+ },
+ {
+ name: '@label',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.select-search.properties.label.description',
+ },
+ {
+ name: '@placeholder',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.select-search.properties.placeholder.description',
+ },
+ {
+ name: '@disabled',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.select-search.properties.disabled.description',
+ },
+ {
+ name: '@multiple',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.select-search.properties.multiple.description',
+ },
+ {
+ name: '@initiallyOpened',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.select-search.properties.initiallyOpened.description',
+ },
+ {
+ name: '@mandatory',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.select-search.properties.mandatory.description',
+ },
+ {
+ name: '@allowClear',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.select-search.properties.allowClear.description',
+ },
+ {
+ name: '@onChange',
+ type: 'function',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.select-search.properties.onChange.description',
+ },
+ {
+ name: '@labelComponent',
+ type: 'Component',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.select-search.properties.labelComponent.description',
+ },
+ {
+ name: '@selectedItemComponent',
+ type: 'Component',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.select-search.properties.selectedItemComponent.description',
+ },
+ {
+ name: '@placeholderComponent',
+ type: 'Component',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.select-search.properties.placeholderComponent.description',
+ },
+ {
+ name: '@searchPlaceholder',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.select-search.properties.searchPlaceholder.description',
+ },
+ {
+ name: '@searchMessage',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.select-search.properties.searchMessage.description',
+ },
+ {
+ name: '@loadingMessage',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.select-search.properties.loadingMessage.description',
+ },
+ {
+ name: '@noMatchesMessage',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.select-search.properties.noMatchesMessage.description',
+ },
+ ],
+ };
+ }
+}
diff --git a/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/select.ts b/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/select.ts
new file mode 100644
index 00000000..de3ecbbb
--- /dev/null
+++ b/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/select.ts
@@ -0,0 +1,108 @@
+import Route from '@ember/routing/route';
+
+export default class DocsEmberInputValidationPrefabsSelectRoute extends Route {
+ model() {
+ return {
+ properties: [
+ {
+ name: '@validationField',
+ type: 'string',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.select.properties.validationField.description',
+ },
+ {
+ name: '@changeset',
+ type: 'ImmerChangeset',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.select.properties.changeset.description',
+ },
+ {
+ name: '@options',
+ type: 'Array',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.select.properties.options.description',
+ },
+ {
+ name: '@label',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.select.properties.label.description',
+ },
+ {
+ name: '@placeholder',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.select.properties.placeholder.description',
+ },
+ {
+ name: '@disabled',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.select.properties.disabled.description',
+ },
+ {
+ name: '@multiple',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.select.properties.multiple.description',
+ },
+ {
+ name: '@mandatory',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.select.properties.mandatory.description',
+ },
+ {
+ name: '@initiallyOpened',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.select.properties.initiallyOpened.description',
+ },
+ {
+ name: '@allowClear',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.select.properties.allowClear.description',
+ },
+ {
+ name: '@onChange',
+ type: 'Function',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.select.properties.onChange.description',
+ },
+ {
+ name: '@labelComponent',
+ type: 'Component',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.select.properties.labelComponent.description',
+ },
+ {
+ name: '@selectedItemComponent',
+ type: 'Component',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.select.properties.selectedItemComponent.description',
+ },
+ {
+ name: '@placeholderComponent',
+ type: 'Component',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.select.properties.placeholderComponent.description',
+ },
+ ],
+ };
+ }
+}
diff --git a/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/textarea.ts b/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/textarea.ts
new file mode 100644
index 00000000..a10cc7bd
--- /dev/null
+++ b/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/textarea.ts
@@ -0,0 +1,73 @@
+import Route from '@ember/routing/route';
+
+export default class DocsEmberInputValidationPrefabsTextareaRoute extends Route {
+ model() {
+ return {
+ properties: [
+ {
+ name: '@validationField',
+ type: 'string',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.textarea.properties.validationField.description',
+ },
+ {
+ name: '@changeset',
+ type: 'ImmerChangeset',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.textarea.properties.changeset.description',
+ },
+ {
+ name: '@label',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.textarea.properties.label.description',
+ },
+ {
+ name: '@placeholder',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.textarea.properties.placeholder.description',
+ },
+ {
+ name: '@mandatory',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.textarea.properties.mandatory.description',
+ },
+ {
+ name: '@disabled',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.textarea.properties.disabled.description',
+ },
+ {
+ name: '@onChange',
+ type: 'Function',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.textarea.properties.onChange.description',
+ },
+ {
+ name: '@changeEvent',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.textarea.properties.changeEvent.description',
+ },
+ {
+ name: '@maxLength',
+ type: 'number',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.textarea.properties.maxLength.description',
+ },
+ ],
+ };
+ }
+}
diff --git a/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/timepicker.ts b/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/timepicker.ts
new file mode 100644
index 00000000..df8a628e
--- /dev/null
+++ b/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/timepicker.ts
@@ -0,0 +1,94 @@
+import Route from '@ember/routing/route';
+
+export default class DocsEmberInputValidationPrefabsTimepickerRoute extends Route {
+ model() {
+ return {
+ properties: [
+ {
+ name: '@validationField',
+ type: 'string',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.timepicker.properties.validationField.description',
+ },
+ {
+ name: '@changeset',
+ type: 'ImmerChangeset',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.timepicker.properties.changeset.description',
+ },
+ {
+ name: '@label',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.timepicker.properties.label.description',
+ },
+ {
+ name: '@onChange',
+ type: 'Function',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.timepicker.properties.onChange.description',
+ },
+ {
+ name: '@onClose',
+ type: 'Function',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.timepicker.properties.onClose.description',
+ },
+ {
+ name: '@disabled',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.timepicker.properties.disabled.description',
+ },
+ {
+ name: '@mandatory',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.timepicker.properties.mandatory.description',
+ },
+ {
+ name: '@enableSecond',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.timepicker.properties.enableSecond.description',
+ },
+ {
+ name: '@stepping',
+ type: 'number',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.timepicker.properties.stepping.description',
+ },
+ {
+ name: '@placeholder',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.timepicker.properties.placeholder.description',
+ },
+ {
+ name: '@clearButton',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.timepicker.properties.clearButton.description',
+ },
+ {
+ name: '@locale',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.timepicker.properties.locale.description',
+ },
+ ],
+ };
+ }
+}
diff --git a/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/vat.ts b/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/vat.ts
new file mode 100644
index 00000000..f1e286ef
--- /dev/null
+++ b/doc-app/app/routes/dashboard/docs/ember-input-validation/prefabs/vat.ts
@@ -0,0 +1,66 @@
+import Route from '@ember/routing/route';
+
+export default class DocsEmberInputValidationPrefabsVatRoute extends Route {
+ model() {
+ return {
+ properties: [
+ {
+ name: '@validationField',
+ type: 'string',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.vat.properties.validationField.description',
+ },
+ {
+ name: '@changeset',
+ type: 'ImmerChangeset',
+ required: true,
+ description:
+ 'ember-input-validation.prefabs.vat.properties.changeset.description',
+ },
+ {
+ name: '@label',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.vat.properties.label.description',
+ },
+ {
+ name: '@placeholder',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.vat.properties.placeholder.description',
+ },
+ {
+ name: '@mandatory',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.vat.properties.mandatory.description',
+ },
+ {
+ name: '@disabled',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.vat.properties.disabled.description',
+ },
+ {
+ name: '@onChange',
+ type: 'Function',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.vat.properties.onChange.description',
+ },
+ {
+ name: '@changeEvent',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-input-validation.prefabs.vat.properties.changeEvent.description',
+ },
+ ],
+ };
+ }
+}
diff --git a/doc-app/app/routes/dashboard/docs/ember-input/prefabs.ts b/doc-app/app/routes/dashboard/docs/ember-input/prefabs.ts
new file mode 100644
index 00000000..739187c6
--- /dev/null
+++ b/doc-app/app/routes/dashboard/docs/ember-input/prefabs.ts
@@ -0,0 +1,3 @@
+import Route from '@ember/routing/route';
+
+export default class DashboardDocsEmberUIPrefabsRoute extends Route {}
diff --git a/doc-app/app/routes/dashboard/docs/ember-input/prefabs/button.ts b/doc-app/app/routes/dashboard/docs/ember-input/prefabs/button.ts
new file mode 100644
index 00000000..defea0b3
--- /dev/null
+++ b/doc-app/app/routes/dashboard/docs/ember-input/prefabs/button.ts
@@ -0,0 +1,31 @@
+import Route from '@ember/routing/route';
+
+export default class DocsEmberInputPrefabsButtonRoute extends Route {
+ model() {
+ return {
+ properties: [
+ {
+ name: '@label',
+ type: 'string',
+ required: true,
+ description:
+ 'ember-input.prefabs.button.properties.field.label.description',
+ },
+ {
+ name: '@onClick',
+ type: 'function',
+ required: true,
+ description:
+ 'ember-input.prefabs.button.properties.field.on-click.description',
+ },
+ {
+ name: '@disabled',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input.prefabs.button.properties.field.disabled.description',
+ },
+ ],
+ };
+ }
+}
diff --git a/doc-app/app/routes/dashboard/docs/ember-input/prefabs/toggle.ts b/doc-app/app/routes/dashboard/docs/ember-input/prefabs/toggle.ts
new file mode 100644
index 00000000..04783d3f
--- /dev/null
+++ b/doc-app/app/routes/dashboard/docs/ember-input/prefabs/toggle.ts
@@ -0,0 +1,31 @@
+import Route from '@ember/routing/route';
+
+export default class DocsEmberInputPrefabsToggleRoute extends Route {
+ model() {
+ return {
+ properties: [
+ {
+ name: '@label',
+ type: 'string',
+ required: true,
+ description:
+ 'ember-input.prefabs.toggle.properties.field.label.description',
+ },
+ {
+ name: '@checked',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input.prefabs.toggle.properties.field.checked.description',
+ },
+ {
+ name: '@disabled',
+ type: 'boolean',
+ required: false,
+ description:
+ 'ember-input.prefabs.toggle.properties.field.disabled.description',
+ },
+ ],
+ };
+ }
+}
diff --git a/doc-app/app/routes/dashboard/docs/ember-ui/prefabs.ts b/doc-app/app/routes/dashboard/docs/ember-ui/prefabs.ts
new file mode 100644
index 00000000..739187c6
--- /dev/null
+++ b/doc-app/app/routes/dashboard/docs/ember-ui/prefabs.ts
@@ -0,0 +1,3 @@
+import Route from '@ember/routing/route';
+
+export default class DashboardDocsEmberUIPrefabsRoute extends Route {}
diff --git a/doc-app/app/routes/dashboard/docs/ember-ui/prefabs/confirm-modal.ts b/doc-app/app/routes/dashboard/docs/ember-ui/prefabs/confirm-modal.ts
new file mode 100644
index 00000000..bfa44f1f
--- /dev/null
+++ b/doc-app/app/routes/dashboard/docs/ember-ui/prefabs/confirm-modal.ts
@@ -0,0 +1,52 @@
+import Route from '@ember/routing/route';
+
+export default class DocsEmberUiPrefabsConfirmModalRoute extends Route {
+ model() {
+ return {
+ properties: [
+ {
+ name: '@onClose',
+ type: 'Function',
+ required: true,
+ description:
+ 'ember-ui.prefabs.confirm-modal.properties.onClose.description',
+ },
+ {
+ name: '@onConfirm',
+ type: 'Function',
+ required: true,
+ description:
+ 'ember-ui.prefabs.confirm-modal.properties.onConfirm.description',
+ },
+ {
+ name: '@cancelText',
+ type: 'string',
+ required: true,
+ description:
+ 'ember-ui.prefabs.confirm-modal.properties.cancelText.description',
+ },
+ {
+ name: '@confirmText',
+ type: 'string',
+ required: true,
+ description:
+ 'ember-ui.prefabs.confirm-modal.properties.confirmText.description',
+ },
+ {
+ name: '@confirmQuestion',
+ type: 'string',
+ required: true,
+ description:
+ 'ember-ui.prefabs.confirm-modal.properties.confirmQuestion.description',
+ },
+ {
+ name: '@isOpen',
+ type: 'boolean',
+ required: true,
+ description:
+ 'ember-ui.prefabs.confirm-modal.properties.isOpen.description',
+ },
+ ],
+ };
+ }
+}
diff --git a/doc-app/app/routes/dashboard/docs/ember-ui/prefabs/table-generic.ts b/doc-app/app/routes/dashboard/docs/ember-ui/prefabs/table-generic.ts
new file mode 100644
index 00000000..c6b65a76
--- /dev/null
+++ b/doc-app/app/routes/dashboard/docs/ember-ui/prefabs/table-generic.ts
@@ -0,0 +1,141 @@
+import Route from '@ember/routing/route';
+import { setupWorker } from 'msw/browser';
+import { http } from 'msw';
+
+const fakeData = [
+ {
+ type: 'user',
+ id: '1',
+ attributes: {
+ lastName: 'Giga',
+ firstName: 'Chad',
+ email: 'info@triptyk.eu',
+ },
+ },
+ {
+ type: 'user',
+ id: '2',
+ attributes: {
+ lastName: 'Marc',
+ firstName: 'Jean',
+ email: 'info@triptyk.eu',
+ },
+ },
+ {
+ type: 'user',
+ id: '3',
+ attributes: {
+ lastName: 'Lepond',
+ firstName: 'Louis',
+ email: 'info@triptyk.eu',
+ },
+ },
+ {
+ type: 'user',
+ id: '4',
+ attributes: {
+ lastName: 'Dragon',
+ firstName: 'Lucas',
+ email: 'info@triptyk.eu',
+ },
+ },
+ {
+ type: 'user',
+ id: '5',
+ attributes: {
+ lastName: 'Leroy',
+ firstName: 'Simon',
+ email: 'info@triptyk.eu',
+ },
+ },
+];
+
+const worker = setupWorker(
+ http.get('/users', () => {
+ return Response.json({
+ data: fakeData,
+ meta: { fetched: fakeData.length, total: fakeData.length },
+ });
+ })
+);
+
+export default class DocsEmberUiPrefabsTpkTableGenericPrefabRoute extends Route {
+ async model() {
+ await worker.start();
+
+ return {
+ properties: [
+ {
+ name: 'tableParams',
+ type: 'TableParams',
+ required: true,
+ description:
+ 'ember-ui.prefabs.tpk-table-generic-prefab.properties.tableParams.description',
+ },
+ {
+ name: 'columnsComponent',
+ type: 'Record>',
+ required: false,
+ description:
+ 'ember-ui.prefabs.tpk-table-generic-prefab.properties.columnsComponent.description',
+ },
+ {
+ name: 'entity',
+ type: 'string',
+ required: true,
+ description:
+ 'ember-ui.prefabs.tpk-table-generic-prefab.properties.entity.description',
+ },
+ {
+ name: 'pageSizes',
+ type: 'number[]',
+ required: false,
+ description:
+ 'ember-ui.prefabs.tpk-table-generic-prefab.properties.pageSizes.description',
+ },
+ {
+ name: 'defaultSortColumn',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-ui.prefabs.tpk-table-generic-prefab.properties.defaultSortColumn.description',
+ },
+ {
+ name: 'additionalFilters',
+ type: 'Record',
+ required: false,
+ description:
+ 'ember-ui.prefabs.tpk-table-generic-prefab.properties.additionalFilters.description',
+ },
+ {
+ name: 'relationships',
+ type: 'string',
+ required: false,
+ description:
+ 'ember-ui.prefabs.tpk-table-generic-prefab.properties.relationships.description',
+ },
+ {
+ name: 'rowClick',
+ type: '(element?: unknown, e?: Event) => void',
+ required: false,
+ description:
+ 'ember-ui.prefabs.tpk-table-generic-prefab.properties.rowClick.description',
+ },
+ {
+ name: 'columns',
+ type: 'Column[]',
+ required: true,
+ description:
+ 'ember-ui.prefabs.tpk-table-generic-prefab.properties.columns.description',
+ },
+ {
+ name: 'actionMenu',
+ type: 'ActionMenuItem[]',
+ required: false,
+ description:
+ 'ember-ui.prefabs.tpk-table-generic-prefab.properties.actionMenu.description',
+ },
+ ],
+ };
+ }
+}
diff --git a/doc-app/app/routes/dashboard/docs/ember-ui/prefabs/tpk-form.ts b/doc-app/app/routes/dashboard/docs/ember-ui/prefabs/tpk-form.ts
new file mode 100644
index 00000000..6b14382d
--- /dev/null
+++ b/doc-app/app/routes/dashboard/docs/ember-ui/prefabs/tpk-form.ts
@@ -0,0 +1,66 @@
+import Route from '@ember/routing/route';
+
+export default class DocsEmberUiPrefabsTpkFormRoute extends Route {
+ model() {
+ return {
+ properties: [
+ {
+ name: '@changeset',
+ type: 'ImmerChangeset',
+ required: true,
+ description:
+ 'ember-ui.prefabs.tpk-form.properties.changeset.description',
+ },
+ {
+ name: '@onSubmit',
+ type: 'Function',
+ required: true,
+ description:
+ 'ember-ui.prefabs.tpk-form.properties.onSubmit.description',
+ },
+ {
+ name: '@validationSchema',
+ type: 'ZodObject',
+ required: true,
+ description:
+ 'ember-ui.prefabs.tpk-form.properties.validationSchema.description',
+ },
+ {
+ name: '@reactive',
+ type: 'Boolean',
+ required: false,
+ description:
+ 'ember-ui.prefabs.tpk-form.properties.reactive.description',
+ },
+ {
+ name: '@removeErrorsOnSubmit',
+ type: 'Boolean',
+ required: false,
+ description:
+ 'ember-ui.prefabs.tpk-form.properties.removeErrorsOnSubmit.description',
+ },
+ {
+ name: '@autoScrollOnError',
+ type: 'Boolean',
+ required: false,
+ description:
+ 'ember-ui.prefabs.tpk-form.properties.autoScrollOnError.description',
+ },
+ {
+ name: '@disabled',
+ type: 'Boolean',
+ required: false,
+ description:
+ 'ember-ui.prefabs.tpk-form.properties.disabled.description',
+ },
+ {
+ name: '@executeOnValid',
+ type: 'Boolean',
+ required: false,
+ description:
+ 'ember-ui.prefabs.tpk-form.properties.executeOnValid.description',
+ },
+ ],
+ };
+ }
+}
diff --git a/doc-app/app/services/.gitkeep b/doc-app/app/services/.gitkeep
new file mode 100644
index 00000000..e69de29b
diff --git a/doc-app/app/services/catch-state.ts b/doc-app/app/services/catch-state.ts
index 25e74057..e9e7d6d2 100644
--- a/doc-app/app/services/catch-state.ts
+++ b/doc-app/app/services/catch-state.ts
@@ -1,14 +1,6 @@
import Service from '@ember/service';
import { tracked } from '@glimmer/tracking';
-export default class CatchState extends Service {
- @tracked state: unknown;
-}
-
-// DO NOT DELETE: this is how TypeScript knows how to look up your services.
-declare module '@ember/service' {
- // eslint-disable-next-line no-unused-vars
- interface Registry {
- 'catch-state': CatchState;
- }
+export default class CatchState extends Service {
+ @tracked state?: T;
}
diff --git a/doc-app/app/services/store.ts b/doc-app/app/services/store.ts
new file mode 100644
index 00000000..9ef0e1a6
--- /dev/null
+++ b/doc-app/app/services/store.ts
@@ -0,0 +1,11 @@
+import { useLegacyStore } from '@warp-drive/legacy';
+import { JSONAPICache } from '@warp-drive/json-api';
+import { UserSchema } from 'doc-app/models/user';
+
+export default useLegacyStore({
+ linksMode: false,
+ legacyRequests: true,
+ modelFragments: true,
+ cache: JSONAPICache,
+ schemas: [UserSchema],
+});
diff --git a/doc-app/app/services/tpk-form.ts b/doc-app/app/services/tpk-form.ts
new file mode 100644
index 00000000..0d499f7c
--- /dev/null
+++ b/doc-app/app/services/tpk-form.ts
@@ -0,0 +1,3 @@
+import TpkFormService from '@triptyk/ember-input-validation/services/tpk-form';
+
+export default TpkFormService;
diff --git a/doc-app/app/styles/app.css b/doc-app/app/styles/app.css
index 370c08e1..bea4c93c 100644
--- a/doc-app/app/styles/app.css
+++ b/doc-app/app/styles/app.css
@@ -1,30 +1,24 @@
-@import url("tailwindcss/base");
-@import url("tailwindcss/components");
-@import url("tailwindcss/utilities");
-@import url("@eonasdan/tempus-dominus/dist/css/tempus-dominus.css");
-@import url("ember-power-select/vendor/ember-power-select.css");
-@import url("@triptyk/ember-input-validation/dist/app.css");
-@import url("@triptyk/ember-input/dist/app.css");
-@import url("@triptyk/ember-ui/dist/app.css");
-@import url("ember-input-validation/form.css");
-
-.next,
-.previous {
- display: flex;
- align-items: center;
- justify-content: center;
-}
-
-.icon {
- display: block;
- width: 1em;
- height: 1em;
- mask-size: contain;
+/* stylelint-disable at-rule-no-unknown */
+/* stylelint-disable at-rule-empty-line-before */
+/* stylelint-disable no-invalid-position-at-import-rule */
+/* stylelint-disable import-notation */
+@import 'tailwindcss';
+@plugin "daisyui" {
+ themes:
+ nord --default,
+ dracula,
+ cupcake,
+ corporate,
+ lemonade;
}
+@import '@triptyk/ember-input/dist/app.css';
+@import '@triptyk/ember-ui/dist/app.css';
+@import '@triptyk/ember-input-validation/dist/app.css';
+@import './code-example.css';
+@import './property-table.css';
+@import './auth.css';
-.ember-power-select-options,
-.ember-power-select-options li,
-.ember-power-select-multiple-options,
-.ember-power-select-multiple-options li {
- margin-bottom: 0 !important;
-}
+/* Additional global styles can be added below */
+@source "../../node_modules/@triptyk/ember-ui";
+@source "../../node_modules/@triptyk/ember-input";
+@source "../../node_modules/@triptyk/ember-input-validation";
diff --git a/doc-app/app/styles/auth.css b/doc-app/app/styles/auth.css
new file mode 100644
index 00000000..5b1b9df3
--- /dev/null
+++ b/doc-app/app/styles/auth.css
@@ -0,0 +1,34 @@
+.auth-layout {
+ @apply flex flex-col items-center justify-center min-h-screen p-4;
+}
+
+.auth-layout-content {
+ @apply flex flex-col items-center w-full max-w-sm gap-4;
+}
+
+.auth-layout-content h1 {
+ @apply text-2xl font-semibold text-base-content;
+}
+
+.auth-layout-content .tpk-login-form,
+.auth-layout-content .tpk-forgot-password-form,
+.auth-layout-content .tpk-reset-password-form {
+ @apply flex flex-col w-full gap-4 bg-base-100 p-8 rounded-2xl shadow-xl border border-base-200;
+}
+
+.auth-layout-content .tpk-login-form-email,
+.auth-layout-content .tpk-login-form-password,
+.auth-layout-content .tpk-forgot-password-form-email,
+.auth-layout-content .tpk-reset-password-form-password,
+.auth-layout-content .tpk-reset-password-form-confirm-password {
+ @apply w-full;
+}
+
+.auth-layout-content button[type='submit'] {
+ @apply w-1/2 mx-auto btn btn-primary;
+}
+
+.auth-layout-content .forgot-password-link,
+.auth-layout-content .login-link {
+ @apply text-sm text-primary hover:underline text-center;
+}
diff --git a/doc-app/app/styles/code-example.css b/doc-app/app/styles/code-example.css
new file mode 100644
index 00000000..533deded
--- /dev/null
+++ b/doc-app/app/styles/code-example.css
@@ -0,0 +1,69 @@
+.code-example {
+ @apply rounded-box bg-base-100 shadow-lg mb-6;
+}
+
+.code-example .component-preview {
+ @apply bg-base-200 p-4 border-b border-base-300;
+}
+
+.code-example .component-preview h3 {
+ @apply text-lg font-semibold text-base-content;
+}
+
+.code-example .tab-content {
+ @apply bg-base-100 p-4 block;
+}
+
+/* doc-app/app/styles/code-block.css */
+.code-block-wrapper {
+ @apply rounded-lg overflow-hidden bg-[#2e3440] text-[#d8dee9] shadow-lg mb-4;
+}
+
+.code-block-header {
+ @apply flex justify-between items-center px-4 py-2 bg-[#3b4252] border-b border-[#434c5e];
+}
+
+.code-block-language {
+ @apply text-xs font-mono uppercase text-[#88c0d0] font-semibold;
+}
+
+.code-block-copy-btn {
+ @apply p-1.5 rounded hover:bg-[#434c5e] transition-colors text-[#d8dee9] hover:text-[#88c0d0];
+}
+
+.code-block-content {
+ @apply overflow-x-auto;
+}
+
+.code-block-content pre {
+ @apply m-0 text-sm font-mono leading-relaxed;
+}
+
+.code-block-content code {
+ @apply text-[#d8dee9];
+}
+
+/* Syntax highlighting basique - style Nord */
+.code-block-content .token.tag {
+ @apply text-[#81a1c1];
+}
+
+.code-block-content .token.attr-name {
+ @apply text-[#8fbcbb];
+}
+
+.code-block-content .token.attr-value {
+ @apply text-[#a3be8c];
+}
+
+.code-block-content .token.punctuation {
+ @apply text-[#eceff4];
+}
+
+.code-block-content .token.string {
+ @apply text-[#a3be8c];
+}
+
+.code-block-content .token.comment {
+ @apply text-[#616e88] italic;
+}
diff --git a/doc-app/app/styles/ember-input-validation/checkbox.css b/doc-app/app/styles/ember-input-validation/checkbox.css
deleted file mode 100644
index 15f2e5cc..00000000
--- a/doc-app/app/styles/ember-input-validation/checkbox.css
+++ /dev/null
@@ -1,7 +0,0 @@
-.tpk-checkbox-input {
- @apply w-5 h-5 rounded border-2 border-gray-300 cursor-pointer;
-}
-
-.tpk-checkbox-label {
- @apply text-gray-600 text-xl;
-}
diff --git a/doc-app/app/styles/ember-input-validation/data-has-error.css b/doc-app/app/styles/ember-input-validation/data-has-error.css
deleted file mode 100644
index f0100625..00000000
--- a/doc-app/app/styles/ember-input-validation/data-has-error.css
+++ /dev/null
@@ -1,27 +0,0 @@
-.error-message {
- @apply bg-red-700 shrink-0 h-5 w-5 text-white font-bold flex justify-center items-center rounded-full relative top-[5px] cursor-pointer z-40;
-
- content: "!";
-}
-
-[data-has-error="true"] .tpk-validation-errors::before {
- @apply error-message;
-}
-
-[data-has-error="true"] input {
- @apply text-red-700 border-0 ring-2 ring-red-700;
-}
-
-[data-has-error="true"] .tpk-validation-errors {
- @apply visible text-red-700 pl-4 pt-2 min-h-[20px] w-auto flex text-sm z-40;
-}
-
-[data-has-error="true"] .tpk-validation-errors span {
- @apply flex items-center w-auto px-3 ml-2 bg-red-100 rounded leading-6;
-
- transition: 0.5s cubic-bezier(0.18, 1.85, 0.16, 0.8);
-}
-
-[data-has-error="true"]:hover .tpk-validation-errors {
- z-index: 55;
-}
diff --git a/doc-app/app/styles/ember-input-validation/form.css b/doc-app/app/styles/ember-input-validation/form.css
deleted file mode 100644
index 1cb8fde8..00000000
--- a/doc-app/app/styles/ember-input-validation/form.css
+++ /dev/null
@@ -1,15 +0,0 @@
-.form-doc .button {
- @apply btn btn-primary;
-}
-
-.form-content {
- @apply grid grid-cols-12 gap-4;
-}
-
-.form-content > * {
- @apply col-span-4;
-}
-
-.form-content > .tpk-mobile-container {
- @apply col-span-8;
-}
diff --git a/doc-app/app/styles/ember-input-validation/index.css b/doc-app/app/styles/ember-input-validation/index.css
deleted file mode 100644
index 5bf372d5..00000000
--- a/doc-app/app/styles/ember-input-validation/index.css
+++ /dev/null
@@ -1,6 +0,0 @@
-@import url("data-has-error.css");
-@import url("input.css");
-@import url("checkbox.css");
-@import url("loading.css");
-@import url("radio.css");
-@import url("form.css");
diff --git a/doc-app/app/styles/ember-input-validation/input.css b/doc-app/app/styles/ember-input-validation/input.css
deleted file mode 100644
index 7f0f228d..00000000
--- a/doc-app/app/styles/ember-input-validation/input.css
+++ /dev/null
@@ -1,40 +0,0 @@
-.tpk-input input,
-.tpk-select-search-input {
- @apply relative block w-full px-3 py-2 text-gray-700 placeholder-gray-400 bg-white border border-gray-300 rounded-md shadow-sm appearance-none focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm;
-}
-
-.tpk-input {
- position: relative;
-}
-
-.tpk-input > div {
- @apply h-full relative;
-}
-
-.tpk-input > label {
- @apply relative block mb-1 text-gray-600;
-}
-
-.tpk-input[data-has-error="true"] > input {
- @apply border-red-300 text-red-900 placeholder-red-300 focus:ring-red-500 focus:border-red-500;
-}
-
-.tpk-input-validation-toggle-button {
- @apply absolute right-1 top-0 h-full;
-}
-
-.tpk-input-phone {
- @apply flex space-x-3;
-}
-
-.tpk-input .flag {
- @apply flex h-auto items-center justify-center space-x-1;
-}
-
-.tpk-input-validation-mobile {
- @apply flex space-x-1;
-}
-
-.tpk-validation-select-search {
- @apply relative;
-}
diff --git a/doc-app/app/styles/ember-input-validation/loading.css b/doc-app/app/styles/ember-input-validation/loading.css
deleted file mode 100644
index a35513ba..00000000
--- a/doc-app/app/styles/ember-input-validation/loading.css
+++ /dev/null
@@ -1,19 +0,0 @@
-.loader {
- @apply w-4 h-4 border-2 border-gray-500;
-
- border-bottom-color: transparent;
- border-radius: 50%;
- display: inline-block;
- box-sizing: border-box;
- animation: rotation 1s linear infinite;
-}
-
-@keyframes rotation {
- 0% {
- transform: rotate(0deg);
- }
-
- 100% {
- transform: rotate(360deg);
- }
-}
diff --git a/doc-app/app/styles/ember-input-validation/radio.css b/doc-app/app/styles/ember-input-validation/radio.css
deleted file mode 100644
index 35428972..00000000
--- a/doc-app/app/styles/ember-input-validation/radio.css
+++ /dev/null
@@ -1,23 +0,0 @@
-.tpk-radio {
- padding-right: 20px;
- margin: 10px;
- width: 23%;
- border-bottom: 1px solid rgb(196 137 252 / 100%);
-}
-
-.tpk-radio-label {
- color: rgb(78 0 151 /100%);
-}
-
-.tpk-validation-radio-group-label {
- font-size: 20px;
- color: rgb(151 73 0 / 100%);
-}
-
-.tpk-validation-radio-group-group .tpk-radio {
- width: 20%;
- margin: 5px;
- padding-left: 5px;
- border-bottom: none;
- border-left: 1px solid rgb(196 137 252 / 100%);
-}
diff --git a/doc-app/app/styles/ember-input/index.css b/doc-app/app/styles/ember-input/index.css
deleted file mode 100644
index 1b51807e..00000000
--- a/doc-app/app/styles/ember-input/index.css
+++ /dev/null
@@ -1,3 +0,0 @@
-@import url("radio.css");
-@import url("select.css");
-@import url("tpk-file.css");
diff --git a/doc-app/app/styles/ember-input/radio.css b/doc-app/app/styles/ember-input/radio.css
deleted file mode 100644
index acb7ccdb..00000000
--- a/doc-app/app/styles/ember-input/radio.css
+++ /dev/null
@@ -1,7 +0,0 @@
-h3 {
- @apply text-2xl font-bold text-cyan-500;
-}
-
-.result-box {
- @apply border-t-2 border-cyan-600;
-}
diff --git a/doc-app/app/styles/ember-input/select.css b/doc-app/app/styles/ember-input/select.css
deleted file mode 100644
index ad662b94..00000000
--- a/doc-app/app/styles/ember-input/select.css
+++ /dev/null
@@ -1,85 +0,0 @@
-.docs-p-4 {
- @apply mb-5;
-}
-
-.tpk-select,
-.tpk-select-search {
- @apply relative;
-}
-
-.tpk-select-options,
-.tpk-select-search-options {
- @apply w-full bg-white z-[60] absolute hidden shadow-lg max-h-60 rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 overflow-auto focus:outline-none sm:text-sm mt-1.5;
-}
-
-.tpk-select .tpk-select-label {
- @apply font-semibold text-gray-700 mb-3;
-}
-
-.tpk-select[data-is-open="true"] .tpk-select-options,
-.tpk-select-search[data-is-open="true"] .tpk-select-search-options {
- @apply block z-[60];
-}
-
-.tpk-select .tpk-select-options-option[aria-selected="true"]::after,
-.tpk-select-search
- .tpk-select-search-options-option[aria-selected="true"]::after {
- content: url("/assets/icons/check-solid.svg");
- position: absolute;
- right: 10px;
- width: 15px;
- height: 15px;
- top: 10px;
-}
-
-.tpk-select .tpk-select-options-option[aria-selected="true"],
-.tpk-select-search .tpk-select-search-options-option[aria-selected="true"] {
- @apply bg-blue-100;
-}
-
-.tpk-select .tpk-select-options-option,
-.tpk-select-search .tpk-select-search-options-option {
- @apply cursor-pointer py-2 mb-0 relative px-3;
-}
-
-.tpk-select .tpk-select-options-option[data-has-focus="true"],
-.tpk-select-search .tpk-select-search-options-option[data-has-focus="true"] {
- @apply bg-gray-50;
-}
-
-.tpk-select .tpk-select-options-option:hover,
-.tpk-select-search .tpk-select-search-options-option:hover {
- @apply bg-blue-200;
-}
-
-.tpk-select-button {
- @apply relative w-full flex rounded shadow-sm px-6 pr-8 py-2 text-left focus:outline-none focus:ring-2 -mb-2 bg-white border-solid border-[1.5px] cursor-pointer text-sm;
-}
-
-.tpk-select-reset-button {
- @apply absolute right-6 top-0 h-full px-4;
-}
-
-.tpk-select-button::after {
- /* arrow down */
- content: "▾";
-
- @apply absolute right-[5px];
-}
-
-.tpk-select[data-is-open="true"] .tpk-select-button::after {
- @apply transform -rotate-180 mt-0.5;
-}
-
-.tpk-select-button:disabled,
-.disabled .tpk-select-button {
- @apply border border-dashed cursor-not-allowed ring-0;
-}
-
-.tpk-select-options .disabled {
- @apply hidden w-0 h-0 ring-0;
-}
-
-.tpk-select aside {
- @apply mt-2;
-}
diff --git a/doc-app/app/styles/ember-input/tpk-file.css b/doc-app/app/styles/ember-input/tpk-file.css
deleted file mode 100644
index 1c4fda1b..00000000
--- a/doc-app/app/styles/ember-input/tpk-file.css
+++ /dev/null
@@ -1,16 +0,0 @@
-.tpk-file {
- display: flex;
- flex-direction: column;
- gap: 1rem;
-}
-
-.tpk-file-input {
- border: none;
- background: #fefefe;
- padding: 10px 20px;
- border-radius: 10px;
- transition: background 0.2s ease-in-out;
- box-shadow:
- rgb(0 0 0 / 5%) 0 6px 24px 0,
- rgb(0 0 0 / 8%) 0 0 0 1px;
-}
diff --git a/doc-app/app/styles/ember-ui/actions-menus.css b/doc-app/app/styles/ember-ui/actions-menus.css
deleted file mode 100644
index abe4b6f7..00000000
--- a/doc-app/app/styles/ember-ui/actions-menus.css
+++ /dev/null
@@ -1,39 +0,0 @@
-.actions {
- @apply flex justify-center items-center p-0 relative;
-}
-
-.actions ul {
- @apply flex flex-col overflow-hidden absolute z-50 bg-white top-[50px] translate-x-full shadow-xl rounded transform scale-y-0 items-start origin-top-right transition duration-300 ease-in-out;
-}
-
-.actions li {
- @apply w-full relative my-1;
-}
-
-.actions button {
- @apply px-4 py-3 flex items-center justify-start transition duration-300;
-}
-
-.actions button:focus,
-.actions button:active {
- @apply outline-none;
-}
-
-/* stylelint-disable-next-line selector-class-pattern */
-button.open_actions {
- @apply rounded-md shadow-md border;
-}
-
-.actions ul button img {
- @apply mr-3 block;
-
- transition: all 0.5s cubic-bezier(0.2, 2.36, 0.36, 0.34);
-}
-
-.actions button:hover img {
- @apply transform rotate-[360deg];
-}
-
-.actions.aopened ul {
- @apply scale-y-100;
-}
diff --git a/doc-app/app/styles/ember-ui/index.css b/doc-app/app/styles/ember-ui/index.css
deleted file mode 100644
index 7b6a49f5..00000000
--- a/doc-app/app/styles/ember-ui/index.css
+++ /dev/null
@@ -1,5 +0,0 @@
-@import url("actions-menus.css");
-@import url("modal.css");
-@import url("table.css");
-@import url("stack-list.css");
-@import url("text-area.css");
diff --git a/doc-app/app/styles/ember-ui/modal.css b/doc-app/app/styles/ember-ui/modal.css
deleted file mode 100644
index bf43060c..00000000
--- a/doc-app/app/styles/ember-ui/modal.css
+++ /dev/null
@@ -1,25 +0,0 @@
-#tpk-modal {
- @apply absolute top-0 left-0;
-}
-
-.open-modal {
- @apply rounded-md shadow-md border px-3 py-1;
-}
-
-.open-modal:focus,
-.open-modal:active {
- @apply outline-none;
-}
-
-.tpk-modal {
- @apply fixed z-[110] h-full w-full flex items-center justify-center bg-gray-500/80;
-}
-
-.tpk-modal-content {
- @apply flex flex-col items-center justify-center px-16 py-8 w-[580px] bg-white rounded-2xl;
-}
-
-.tpk-confirm-modal-title {
- /* FIX FOR DESIGN BUT NEED TO ADAPT TPK Confirm */
- @apply hidden;
-}
diff --git a/doc-app/app/styles/ember-ui/stack-list.css b/doc-app/app/styles/ember-ui/stack-list.css
deleted file mode 100644
index 224afea4..00000000
--- a/doc-app/app/styles/ember-ui/stack-list.css
+++ /dev/null
@@ -1,47 +0,0 @@
-.tpk-stack {
- @apply w-full h-full rounded-md shadow-gray-300 shadow-md p-2 mb-4;
-}
-
-.tpk-stack-title {
- @apply pl-4 font-semibold text-gray-600;
-}
-
-.tpk-stack-head {
- @apply w-full h-6 flex justify-between items-center;
-}
-
-.origin-top {
- @apply text-gray-800 pl-4;
-}
-
-.tpk-stack-head button {
- @apply w-4 h-4;
-}
-
-.link {
- @apply w-full h-6 flex mt-4;
-}
-
-.icon span {
- @apply pl-2;
-}
-
-[data-is-expanded="true"] {
- @apply h-full scale-y-100;
-}
-
-[data-is-expanded="false"] {
- @apply h-0 scale-y-0 overflow-hidden;
-}
-
-.tpk-stack-head-expand-btn {
- @apply duration-200;
-}
-
-[data-is-expanded-btn="true"] {
- @apply rotate-0;
-}
-
-[data-is-expanded-btn="false"] {
- transform: rotate(90deg);
-}
diff --git a/doc-app/app/styles/ember-ui/table.css b/doc-app/app/styles/ember-ui/table.css
deleted file mode 100644
index 402e907e..00000000
--- a/doc-app/app/styles/ember-ui/table.css
+++ /dev/null
@@ -1,181 +0,0 @@
-/* stylelint-disable selector-class-pattern */
-.tpk-table-generic {
- @apply mt-8 w-full;
-}
-
-.tpk-table-generic a {
- @apply text-blue-500 inline-block;
-}
-
-.tpk-table-generic a::before {
- display: none;
-}
-
-.tpk-table-generic tr {
- @apply bg-gray-100;
-}
-
-.tpk-table-generic thead tr {
- @apply border-b-2 bg-gray-100;
-}
-
-.tpk-table-generic th {
- @apply py-3 h-12 font-medium border-b-2 border-b-gray-900/30 shrink-0 grow-0;
-}
-
-.tpk-table-generic td {
- @apply relative text-center py-4 border-b-[3px] border-white shrink-0 grow-0;
-}
-
-.tpk-table-search button {
- @apply absolute left-0 top-2.5 w-5 h-5 ml-3;
-
- background: url("/assets/icons/search.svg") center left no-repeat;
- background-size: cover;
-}
-
-.custom-table td,
-.custom-table th {
- flex-grow: 1;
-}
-
-.tpk-table-generic th,
-.tpk-table-generic td {
- @apply w-[100px] max-w-[150px] px-4 box-content;
-}
-
-.tpk-table-generic td.small,
-.tpk-table-generic th.small {
- @apply w-[50px] max-w-[50px] grow-0 shrink;
-}
-
-.tpk-table-generic td.selectable,
-.tpk-table-generic th.selectable {
- @apply w-[50px] max-w-[50px] m-0 p-0;
-}
-
-.tpk-table-generic td.custom-cell,
-.tpk-table-generic th.custom-cell {
- @apply w-[30px];
-}
-
-.tpk-table-generic td.big,
-.tpk-table-generic th.big {
- @apply w-[250px] min-w-[150px] grow whitespace-normal;
-}
-
-.tpk-table-generic td,
-.tpk-table-generic td:last-child,
-.tpk-table-generic th:last-child {
- @apply rounded-r;
-}
-
-.tpk-table-generic td:first-child,
-.tpk-table-generic th:first-child {
- @apply rounded-l-md;
-}
-
-.tpk-table-generic .status::before {
- content: "";
-
- @apply absolute w-2.5 rounded-sm h-full block left-0 top-0;
-}
-
-.tpk-table-generic tfoot tr {
- @apply bg-transparent;
-}
-
-.yeti-table-pagination-controls {
- @apply w-full flex flex-col justify-center items-center my-8;
-}
-
-.yeti-table-pagination-controls-page-info,
-.yeti-table-pagination-controls-page-size {
- @apply bg-transparent text-center text-gray-800;
-}
-
-.yeti-table-pagination-controls-page-size select {
- @apply border-b-2 border-gray-400;
-}
-
-.yeti-table-pagination-buttons button {
- @apply cursor-pointer;
-}
-
-.yeti-table-pagination-buttons button img {
- filter: invert(13%) sepia(6%) saturate(5813%) hue-rotate(157deg)
- brightness(100%) contrast(90%);
-}
-
-.yeti-table-pagination-buttons button:hover img {
- filter: invert(61%) sepia(99%) saturate(3877%) hue-rotate(167deg)
- brightness(89%) contrast(96%);
-}
-
-.yeti-table-pagination-buttons button:disabled {
- @apply cursor-default;
-}
-
-.yeti-table-pagination-buttons button:disabled img {
- filter: invert(70%) sepia(0%) saturate(2309%) hue-rotate(26deg)
- brightness(92%) contrast(97%);
- opacity: 0.5;
-}
-
-.yeti-table-pagination-controls-previous {
- @apply mr-12;
-}
-
-.yeti-table-pagination-controls-next {
- @apply ml-12;
-}
-
-.tpk-table-generic th.yeti-table-sortable {
- @apply relative;
-}
-
-.tpk-table-generic th.yeti-table-sortable::after {
- @apply inline-block text-orange-400;
-
- content: "\25BF";
- margin-left: 5px;
-}
-
-table.yeti-table thead th.yeti-table-sorted-asc::after {
- @apply text-orange-400;
-
- content: "\25BE";
- margin-left: 5px;
-}
-
-table.yeti-table thead th.yeti-table-sorted-desc::after {
- @apply text-orange-400;
-
- content: "\25BE";
- transform: rotate(180deg);
- margin-left: 5px;
-}
-
-table.yeti-table .yeti-table-sortable {
- white-space: nowrap;
-}
-
-.statusSelector .tpk-select-button {
- @apply bg-white rounded-xl;
-}
-
-.tpk-table-search {
- @apply relative rounded-lg bg-gray-100;
-}
-
-.tpk-table-search label {
- @apply sr-only;
-}
-
-.tpk-table-search input {
- @apply p-2 bg-transparent w-full pl-14;
-}
-
-.tpk-table-search button span {
- @apply sr-only;
-}
diff --git a/doc-app/app/styles/ember-ui/text-area.css b/doc-app/app/styles/ember-ui/text-area.css
deleted file mode 100644
index 08ab9373..00000000
--- a/doc-app/app/styles/ember-ui/text-area.css
+++ /dev/null
@@ -1,15 +0,0 @@
-.tpk-textarea {
- @apply flex flex-col;
-}
-
-.tpk-textarea > label {
- @apply text-gray-500 pb-1 pl-2;
-}
-
-.tpk-textarea-input {
- @apply border border-gray-300 rounded-md shadow-sm p-2;
-}
-
-.text-area-count {
- @apply text-gray-500 pt-1 pr-2 pb-4 float-right;
-}
diff --git a/doc-app/app/styles/property-table.css b/doc-app/app/styles/property-table.css
new file mode 100644
index 00000000..12399a7d
--- /dev/null
+++ b/doc-app/app/styles/property-table.css
@@ -0,0 +1,15 @@
+.table {
+ @apply min-w-[90%] divide-y divide-base-300;
+}
+
+.table-header {
+ @apply bg-base-200;
+}
+
+.table-header-content {
+ @apply px-6 py-3 text-left text-xs font-medium text-base-content/70 uppercase tracking-wider;
+}
+
+.table-body {
+ @apply bg-base-100 divide-y divide-base-300;
+}
diff --git a/doc-app/app/templates/application.gts b/doc-app/app/templates/application.gts
new file mode 100644
index 00000000..2e30c44c
--- /dev/null
+++ b/doc-app/app/templates/application.gts
@@ -0,0 +1,6 @@
+
+
+
+
+ {{outlet}}
+
diff --git a/doc-app/app/templates/application.hbs b/doc-app/app/templates/application.hbs
deleted file mode 100644
index 5c6d7546..00000000
--- a/doc-app/app/templates/application.hbs
+++ /dev/null
@@ -1,5 +0,0 @@
-
- {{!-- @glint-ignore --}}
-
- {{outlet}}
-
diff --git a/doc-app/app/templates/dashboard.gts b/doc-app/app/templates/dashboard.gts
new file mode 100644
index 00000000..4f3f881a
--- /dev/null
+++ b/doc-app/app/templates/dashboard.gts
@@ -0,0 +1,328 @@
+import Component from '@glimmer/component';
+import TpkDashBoard, {
+ type Language,
+ type SidebarItem,
+} from '@triptyk/ember-ui/components/prefabs/tpk-dashboard';
+import type { TOC } from '@ember/component/template-only';
+import ThemeSelector from 'doc-app/components/theme-selector';
+import { service } from '@ember/service';
+import type { IntlService } from 'ember-intl';
+import { action } from '@ember/object';
+
+export default class DashboardTemplate extends Component {
+ @service declare intl: IntlService;
+
+ languages: Language[] = [
+ { code: 'fr-fr', label: 'Français' },
+ { code: 'en-us', label: 'Anglais' },
+ ];
+
+ @action
+ handleLocaleChange(locale: string) {
+ this.intl.setLocale([locale]);
+ }
+
+ menuItems: SidebarItem[] = [
+ {
+ type: 'link',
+ label: 'Getting Started',
+ route: 'dashboard.docs.ember-input-validation.prefabs.input',
+ icon:
+
+
+
+ as TOC<{ Element: SVGSVGElement }>,
+ },
+ {
+ type: 'link',
+ label: 'Installation',
+ route: 'dashboard.docs.ember-input-validation.prefabs.input',
+ icon:
+
+
+
+ as TOC<{ Element: SVGSVGElement }>,
+ },
+ {
+ type: 'group',
+ isOpen: true,
+ label: 'Ember Input Validation Prefab',
+ items: [
+ {
+ type: 'link',
+ label: 'Input',
+ route: 'dashboard.docs.ember-input-validation.prefabs.input',
+ },
+ {
+ type: 'link',
+ label: 'Integer',
+ route: 'dashboard.docs.ember-input-validation.prefabs.integer',
+ },
+ {
+ type: 'link',
+ label: 'Number',
+ route: 'dashboard.docs.ember-input-validation.prefabs.number',
+ },
+ {
+ type: 'link',
+ label: 'Datepicker',
+ route: 'dashboard.docs.ember-input-validation.prefabs.datepicker',
+ },
+ {
+ type: 'link',
+ label: 'Datepicker Range',
+ route:
+ 'dashboard.docs.ember-input-validation.prefabs.datepicker-range',
+ },
+ {
+ type: 'link',
+ label: 'Timepicker',
+ route: 'dashboard.docs.ember-input-validation.prefabs.timepicker',
+ },
+ {
+ type: 'link',
+ label: 'Select',
+ route: 'dashboard.docs.ember-input-validation.prefabs.select',
+ },
+ {
+ type: 'link',
+ label: 'Select Create',
+ route: 'dashboard.docs.ember-input-validation.prefabs.select-create',
+ },
+ {
+ type: 'link',
+ label: 'Select Search',
+ route: 'dashboard.docs.ember-input-validation.prefabs.select-search',
+ },
+ {
+ type: 'link',
+ label: 'Radio',
+ route: 'dashboard.docs.ember-input-validation.prefabs.radio',
+ },
+ {
+ type: 'link',
+ label: 'Radio Group',
+ route: 'dashboard.docs.ember-input-validation.prefabs.radio-group',
+ },
+ {
+ type: 'link',
+ label: 'Textarea',
+ route: 'dashboard.docs.ember-input-validation.prefabs.textarea',
+ },
+ {
+ type: 'link',
+ label: 'Password',
+ route: 'dashboard.docs.ember-input-validation.prefabs.password',
+ },
+ {
+ type: 'link',
+ label: 'Email',
+ route: 'dashboard.docs.ember-input-validation.prefabs.email',
+ },
+ {
+ type: 'link',
+ label: 'Mobile',
+ route: 'dashboard.docs.ember-input-validation.prefabs.mobile',
+ },
+ {
+ type: 'link',
+ label: 'File',
+ route: 'dashboard.docs.ember-input-validation.prefabs.file',
+ },
+ {
+ type: 'link',
+ label: 'File List',
+ route: 'dashboard.docs.ember-input-validation.prefabs.file-list',
+ },
+ {
+ type: 'link',
+ label: 'Currency',
+ route: 'dashboard.docs.ember-input-validation.prefabs.currency',
+ },
+ {
+ type: 'link',
+ label: 'BIC',
+ route: 'dashboard.docs.ember-input-validation.prefabs.bic',
+ },
+ {
+ type: 'link',
+ label: 'IBAN',
+ route: 'dashboard.docs.ember-input-validation.prefabs.iban',
+ },
+ {
+ type: 'link',
+ label: 'VAT',
+ route: 'dashboard.docs.ember-input-validation.prefabs.vat',
+ },
+ {
+ type: 'link',
+ label: 'National Number',
+ route:
+ 'dashboard.docs.ember-input-validation.prefabs.national-number',
+ },
+ ],
+ },
+ {
+ type: 'group',
+ label: 'Ember UI Prefab',
+ items: [
+ {
+ type: 'link',
+ label: 'Confirm Modal',
+ route: 'dashboard.docs.ember-ui.prefabs.confirm-modal',
+ },
+ {
+ type: 'link',
+ label: 'Table Generic',
+ route: 'dashboard.docs.ember-ui.prefabs.table-generic',
+ },
+ {
+ type: 'link',
+ label: 'Tpk Form',
+ route: 'dashboard.docs.ember-ui.prefabs.tpk-form',
+ },
+ ],
+ },
+ {
+ type: 'group',
+ label: 'Ember Input Prefab',
+ items: [
+ {
+ type: 'link',
+ label: 'Button Prefab',
+ route: 'dashboard.docs.ember-input.prefabs.button',
+ },
+ {
+ type: 'link',
+ label: 'Toggle',
+ route: 'dashboard.docs.ember-input.prefabs.toggle',
+ },
+ ],
+ },
+ ];
+
+
+
+
+ <:header>
+
+
+
EMBER COMMON UI
+
+
+ <:footer>
+
+
+ <:content>
+
+ {{outlet}}
+
+
+
+
+
+}
diff --git a/doc-app/app/templates/dashboard/docs.gts b/doc-app/app/templates/dashboard/docs.gts
new file mode 100644
index 00000000..f3b67262
--- /dev/null
+++ b/doc-app/app/templates/dashboard/docs.gts
@@ -0,0 +1 @@
+{{outlet}}
diff --git a/doc-app/app/templates/dashboard/docs/ember-input-validation.gts b/doc-app/app/templates/dashboard/docs/ember-input-validation.gts
new file mode 100644
index 00000000..f3b67262
--- /dev/null
+++ b/doc-app/app/templates/dashboard/docs/ember-input-validation.gts
@@ -0,0 +1 @@
+{{outlet}}
diff --git a/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs.gts b/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs.gts
new file mode 100644
index 00000000..f3b67262
--- /dev/null
+++ b/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs.gts
@@ -0,0 +1 @@
+{{outlet}}
diff --git a/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/bic.gts b/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/bic.gts
new file mode 100644
index 00000000..a8287049
--- /dev/null
+++ b/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/bic.gts
@@ -0,0 +1,62 @@
+import Component from '@glimmer/component';
+import DocPage from 'doc-app/components/doc/page';
+import DocSection from 'doc-app/components/doc/section';
+import DocPropertyTable from 'doc-app/components/doc/property-table';
+import { t, type IntlService } from 'ember-intl';
+import BasicBicExample from 'doc-app/components/docs/ember-input-validation/prefabs/basic-bic.gts';
+import DisabledBicExample from 'doc-app/components/docs/ember-input-validation/prefabs/disabled-bic.gts';
+import ErrorBicExample from 'doc-app/components/docs/ember-input-validation/prefabs/error-bic.gts';
+import { service } from '@ember/service';
+import CodeExampleComponent from 'doc-app/components/doc/code-example.gts';
+import CodeBlock from 'doc-app/components/doc/code-block.gts';
+import type { Property } from 'doc-app/utils/table-property.interface';
+
+interface BicPrefabDocsSignature {
+ Args: {
+ model: {
+ properties: Property[];
+ };
+ };
+}
+
+export default class BicPrefabDocs extends Component {
+ @service declare intl: IntlService;
+
+ bic = `
+
+ `;
+
+
+
+
+
+ <:demo>
+
+
+
+
+
+
+ <:template>
+
+
+
+
+
+
+
+
+
+}
diff --git a/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/currency.gts b/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/currency.gts
new file mode 100644
index 00000000..0ab5cc08
--- /dev/null
+++ b/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/currency.gts
@@ -0,0 +1,62 @@
+import Component from '@glimmer/component';
+import DocPage from 'doc-app/components/doc/page';
+import DocSection from 'doc-app/components/doc/section';
+import DocPropertyTable from 'doc-app/components/doc/property-table';
+import { t, type IntlService } from 'ember-intl';
+import BasicCurrencyExample from 'doc-app/components/docs/ember-input-validation/prefabs/basic-currency.gts';
+import DisabledCurrencyExample from 'doc-app/components/docs/ember-input-validation/prefabs/disabled-currency.gts';
+import ErrorCurrencyExample from 'doc-app/components/docs/ember-input-validation/prefabs/error-currency.gts';
+import { service } from '@ember/service';
+import CodeExampleComponent from 'doc-app/components/doc/code-example.gts';
+import CodeBlock from 'doc-app/components/doc/code-block.gts';
+import type { Property } from 'doc-app/utils/table-property.interface';
+
+interface CurrencyPrefabDocsSignature {
+ Args: {
+ model: {
+ properties: Property[];
+ };
+ };
+}
+
+export default class CurrencyPrefabDocs extends Component {
+ @service declare intl: IntlService;
+
+ currency = `
+
+ `;
+
+
+
+
+
+ <:demo>
+
+
+
+
+
+
+ <:template>
+
+
+
+
+
+
+
+
+
+}
diff --git a/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/datepicker-range.gts b/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/datepicker-range.gts
new file mode 100644
index 00000000..cea23aff
--- /dev/null
+++ b/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/datepicker-range.gts
@@ -0,0 +1,67 @@
+import Component from '@glimmer/component';
+import DocPage from 'doc-app/components/doc/page';
+import DocSection from 'doc-app/components/doc/section';
+import DocPropertyTable from 'doc-app/components/doc/property-table';
+import { t, type IntlService } from 'ember-intl';
+import BasicDatepickerRangeExample from 'doc-app/components/docs/ember-input-validation/prefabs/basic-datepicker-range.gts';
+import DisabledDatepickerRangeExample from 'doc-app/components/docs/ember-input-validation/prefabs/disabled-datepicker-range.gts';
+import ErrorDatepickerRangeExample from 'doc-app/components/docs/ember-input-validation/prefabs/error-datepicker-range.gts';
+import { service } from '@ember/service';
+import CodeExampleComponent from 'doc-app/components/doc/code-example.gts';
+import CodeBlock from 'doc-app/components/doc/code-block.gts';
+import type { Property } from 'doc-app/utils/table-property.interface';
+
+interface DatepickerRangePrefabDocsSignature {
+ Args: {
+ model: {
+ properties: Property[];
+ };
+ };
+}
+
+export default class DatepickerRangePrefabDocs extends Component {
+ @service declare intl: IntlService;
+
+ datepickerRange = `
+
+ `;
+
+
+
+
+
+ <:demo>
+
+
+
+
+
+
+ <:template>
+
+
+
+
+
+
+
+
+
+}
diff --git a/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/datepicker.gts b/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/datepicker.gts
new file mode 100644
index 00000000..f522a3e5
--- /dev/null
+++ b/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/datepicker.gts
@@ -0,0 +1,61 @@
+import Component from '@glimmer/component';
+import DocPage from 'doc-app/components/doc/page';
+import DocSection from 'doc-app/components/doc/section';
+import DocPropertyTable from 'doc-app/components/doc/property-table';
+import { t, type IntlService } from 'ember-intl';
+import BasicDatepickerExample from 'doc-app/components/docs/ember-input-validation/prefabs/basic-datepicker.gts';
+import DisabledDatepickerExample from 'doc-app/components/docs/ember-input-validation/prefabs/disabled-datepicker.gts';
+import ErrorDatepickerExample from 'doc-app/components/docs/ember-input-validation/prefabs/error-datepicker.gts';
+import { service } from '@ember/service';
+import CodeExampleComponent from 'doc-app/components/doc/code-example.gts';
+import CodeBlock from 'doc-app/components/doc/code-block.gts';
+import type { Property } from 'doc-app/utils/table-property.interface';
+
+interface DatepickerPrefabDocsSignature {
+ Args: {
+ model: {
+ properties: Property[];
+ };
+ };
+}
+
+export default class DatepickerPrefabDocs extends Component {
+ @service declare intl: IntlService;
+
+ datepicker = `
+
+ `;
+
+
+
+
+
+ <:demo>
+
+
+
+
+
+
+ <:template>
+
+
+
+
+
+
+
+
+
+}
diff --git a/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/email.gts b/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/email.gts
new file mode 100644
index 00000000..549ee67b
--- /dev/null
+++ b/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/email.gts
@@ -0,0 +1,62 @@
+import Component from '@glimmer/component';
+import DocPage from 'doc-app/components/doc/page';
+import DocSection from 'doc-app/components/doc/section';
+import DocPropertyTable from 'doc-app/components/doc/property-table';
+import { t, type IntlService } from 'ember-intl';
+import BasicEmailExample from 'doc-app/components/docs/ember-input-validation/prefabs/basic-email.gts';
+import DisabledEmailExample from 'doc-app/components/docs/ember-input-validation/prefabs/disabled-email.gts';
+import ErrorEmailExample from 'doc-app/components/docs/ember-input-validation/prefabs/error-email.gts';
+import { service } from '@ember/service';
+import CodeExampleComponent from 'doc-app/components/doc/code-example.gts';
+import CodeBlock from 'doc-app/components/doc/code-block.gts';
+import type { Property } from 'doc-app/utils/table-property.interface';
+
+interface EmailPrefabDocsSignature {
+ Args: {
+ model: {
+ properties: Property[];
+ };
+ };
+}
+
+export default class EmailPrefabDocs extends Component {
+ @service declare intl: IntlService;
+
+ email = `
+
+ `;
+
+
+
+
+
+ <:demo>
+
+
+
+
+
+
+ <:template>
+
+
+
+
+
+
+
+
+
+}
diff --git a/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/file-list.gts b/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/file-list.gts
new file mode 100644
index 00000000..76b928bc
--- /dev/null
+++ b/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/file-list.gts
@@ -0,0 +1,62 @@
+import Component from '@glimmer/component';
+import DocPage from 'doc-app/components/doc/page';
+import DocSection from 'doc-app/components/doc/section';
+import DocPropertyTable from 'doc-app/components/doc/property-table';
+import { t, type IntlService } from 'ember-intl';
+import BasicFileListExample from 'doc-app/components/docs/ember-input-validation/prefabs/basic-file-list.gts';
+import DisabledFileListExample from 'doc-app/components/docs/ember-input-validation/prefabs/disabled-file-list.gts';
+import ErrorFileListExample from 'doc-app/components/docs/ember-input-validation/prefabs/error-file-list.gts';
+import { service } from '@ember/service';
+import CodeExampleComponent from 'doc-app/components/doc/code-example.gts';
+import CodeBlock from 'doc-app/components/doc/code-block.gts';
+import type { Property } from 'doc-app/utils/table-property.interface';
+
+interface FileListPrefabDocsSignature {
+ Args: {
+ model: {
+ properties: Property[];
+ };
+ };
+}
+
+export default class FileListPrefabDocs extends Component {
+ @service declare intl: IntlService;
+
+ fileList = `
+
+ `;
+
+
+
+
+
+ <:demo>
+
+
+
+
+
+
+ <:template>
+
+
+
+
+
+
+
+
+
+}
diff --git a/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/file.gts b/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/file.gts
new file mode 100644
index 00000000..ddd2c08b
--- /dev/null
+++ b/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/file.gts
@@ -0,0 +1,61 @@
+import Component from '@glimmer/component';
+import DocPage from 'doc-app/components/doc/page';
+import DocSection from 'doc-app/components/doc/section';
+import DocPropertyTable from 'doc-app/components/doc/property-table';
+import { t, type IntlService } from 'ember-intl';
+import BasicFileExample from 'doc-app/components/docs/ember-input-validation/prefabs/basic-file.gts';
+import DisabledFileExample from 'doc-app/components/docs/ember-input-validation/prefabs/disabled-file.gts';
+import ErrorFileExample from 'doc-app/components/docs/ember-input-validation/prefabs/error-file.gts';
+import { service } from '@ember/service';
+import CodeExampleComponent from 'doc-app/components/doc/code-example.gts';
+import CodeBlock from 'doc-app/components/doc/code-block.gts';
+import type { Property } from 'doc-app/utils/table-property.interface';
+
+interface FilePrefabDocsSignature {
+ Args: {
+ model: {
+ properties: Property[];
+ };
+ };
+}
+
+export default class FilePrefabDocs extends Component {
+ @service declare intl: IntlService;
+
+ file = `
+
+ `;
+
+
+
+
+
+ <:demo>
+
+
+
+
+
+
+ <:template>
+
+
+
+
+
+
+
+
+
+}
diff --git a/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/iban.gts b/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/iban.gts
new file mode 100644
index 00000000..ef93700a
--- /dev/null
+++ b/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/iban.gts
@@ -0,0 +1,62 @@
+import Component from '@glimmer/component';
+import DocPage from 'doc-app/components/doc/page';
+import DocSection from 'doc-app/components/doc/section';
+import DocPropertyTable from 'doc-app/components/doc/property-table';
+import { t, type IntlService } from 'ember-intl';
+import BasicIbanExample from 'doc-app/components/docs/ember-input-validation/prefabs/basic-iban.gts';
+import DisabledIbanExample from 'doc-app/components/docs/ember-input-validation/prefabs/disabled-iban.gts';
+import ErrorIbanExample from 'doc-app/components/docs/ember-input-validation/prefabs/error-iban.gts';
+import { service } from '@ember/service';
+import CodeExampleComponent from 'doc-app/components/doc/code-example.gts';
+import CodeBlock from 'doc-app/components/doc/code-block.gts';
+import type { Property } from 'doc-app/utils/table-property.interface';
+
+interface IbanPrefabDocsSignature {
+ Args: {
+ model: {
+ properties: Property[];
+ };
+ };
+}
+
+export default class IbanPrefabDocs extends Component {
+ @service declare intl: IntlService;
+
+ iban = `
+
+ `;
+
+
+
+
+
+ <:demo>
+
+
+
+
+
+
+ <:template>
+
+
+
+
+
+
+
+
+
+}
diff --git a/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/input.gts b/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/input.gts
new file mode 100644
index 00000000..3d9c982b
--- /dev/null
+++ b/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/input.gts
@@ -0,0 +1,60 @@
+import Component from '@glimmer/component';
+import DocPage from 'doc-app/components/doc/page';
+import DocSection from 'doc-app/components/doc/section';
+import DocPropertyTable from 'doc-app/components/doc/property-table';
+import { t, type IntlService } from 'ember-intl';
+import BasicInputExample from 'doc-app/components/docs/ember-input-validation/prefabs/basic-input.gts';
+import DisabledInputExample from 'doc-app/components/docs/ember-input-validation/prefabs/disabled-input.gts';
+import ErrorInputExample from 'doc-app/components/docs/ember-input-validation/prefabs/error-input.gts';
+import { service } from '@ember/service';
+import CodeExampleComponent from 'doc-app/components/doc/code-example.gts';
+import CodeBlock from 'doc-app/components/doc/code-block.gts';
+import type { Property } from 'doc-app/utils/table-property.interface';
+
+interface InputPrefabDocsSignature {
+ Args: {
+ model: {
+ properties: Property[];
+ };
+ };
+}
+
+export default class InputPrefabDocs extends Component {
+ @service declare intl: IntlService;
+ input = `
+
+ `;
+
+
+
+
+
+ <:demo>
+
+
+
+
+
+
+ <:template>
+
+
+
+
+
+
+
+
+
+}
diff --git a/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/integer.gts b/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/integer.gts
new file mode 100644
index 00000000..12c3c1ed
--- /dev/null
+++ b/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/integer.gts
@@ -0,0 +1,63 @@
+import Component from '@glimmer/component';
+import DocPage from 'doc-app/components/doc/page';
+import DocSection from 'doc-app/components/doc/section';
+import DocPropertyTable from 'doc-app/components/doc/property-table';
+import { t, type IntlService } from 'ember-intl';
+import BasicIntegerExample from 'doc-app/components/docs/ember-input-validation/prefabs/basic-integer.gts';
+import DisabledIntegerExample from 'doc-app/components/docs/ember-input-validation/prefabs/disabled-integer.gts';
+import ErrorIntegerExample from 'doc-app/components/docs/ember-input-validation/prefabs/error-integer.gts';
+import { service } from '@ember/service';
+import CodeExampleComponent from 'doc-app/components/doc/code-example.gts';
+import CodeBlock from 'doc-app/components/doc/code-block.gts';
+import type { Property } from 'doc-app/utils/table-property.interface';
+
+interface IntegerPrefabDocsSignature {
+ Args: {
+ model: {
+ properties: Property[];
+ };
+ };
+}
+
+export default class IntegerPrefabDocs extends Component {
+ @service declare intl: IntlService;
+
+ integer = `
+
+ `;
+
+
+
+
+
+ <:demo>
+
+
+
+
+
+
+ <:template>
+
+
+
+
+
+
+
+
+
+}
diff --git a/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/mobile.gts b/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/mobile.gts
new file mode 100644
index 00000000..59eb8b83
--- /dev/null
+++ b/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/mobile.gts
@@ -0,0 +1,61 @@
+import Component from '@glimmer/component';
+import DocPage from 'doc-app/components/doc/page';
+import DocSection from 'doc-app/components/doc/section';
+import DocPropertyTable from 'doc-app/components/doc/property-table';
+import { t, type IntlService } from 'ember-intl';
+import BasicMobileExample from 'doc-app/components/docs/ember-input-validation/prefabs/basic-mobile.gts';
+import DisabledMobileExample from 'doc-app/components/docs/ember-input-validation/prefabs/disabled-mobile.gts';
+import ErrorMobileExample from 'doc-app/components/docs/ember-input-validation/prefabs/error-mobile.gts';
+import { service } from '@ember/service';
+import CodeExampleComponent from 'doc-app/components/doc/code-example.gts';
+import CodeBlock from 'doc-app/components/doc/code-block.gts';
+import type { Property } from 'doc-app/utils/table-property.interface';
+
+interface MobilePrefabDocsSignature {
+ Args: {
+ model: {
+ properties: Property[];
+ };
+ };
+}
+
+export default class MobilePrefabDocs extends Component {
+ @service declare intl: IntlService;
+
+ mobile = `
+
+ `;
+
+
+
+
+
+ <:demo>
+
+
+
+
+
+
+ <:template>
+
+
+
+
+
+
+
+
+
+}
diff --git a/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/national-number.gts b/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/national-number.gts
new file mode 100644
index 00000000..4f6c0cf5
--- /dev/null
+++ b/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/national-number.gts
@@ -0,0 +1,68 @@
+import Component from '@glimmer/component';
+import DocPage from 'doc-app/components/doc/page';
+import DocSection from 'doc-app/components/doc/section';
+import DocPropertyTable from 'doc-app/components/doc/property-table';
+import { t, type IntlService } from 'ember-intl';
+import BasicNationalNumberExample from 'doc-app/components/docs/ember-input-validation/prefabs/basic-national-number.gts';
+import DisabledNationalNumberExample from 'doc-app/components/docs/ember-input-validation/prefabs/disabled-national-number.gts';
+import ErrorNationalNumberExample from 'doc-app/components/docs/ember-input-validation/prefabs/error-national-number.gts';
+import { service } from '@ember/service';
+import CodeExampleComponent from 'doc-app/components/doc/code-example.gts';
+import CodeBlock from 'doc-app/components/doc/code-block.gts';
+import type { Property } from 'doc-app/utils/table-property.interface';
+
+interface NationalNumberPrefabDocsSignature {
+ Args: {
+ model: {
+ properties: Property[];
+ };
+ };
+}
+
+export default class NationalNumberPrefabDocs extends Component {
+ @service declare intl: IntlService;
+
+ nationalNumber = `
+
+ `;
+
+
+
+
+
+ <:demo>
+
+
+
+
+
+
+ <:template>
+
+
+
+
+
+
+
+
+
+}
diff --git a/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/number.gts b/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/number.gts
new file mode 100644
index 00000000..fc795f02
--- /dev/null
+++ b/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/number.gts
@@ -0,0 +1,85 @@
+// doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/number.gts
+import Component from '@glimmer/component';
+import DocPage from 'doc-app/components/doc/page';
+import DocSection from 'doc-app/components/doc/section';
+import DocPropertyTable from 'doc-app/components/doc/property-table';
+import { t, type IntlService } from 'ember-intl';
+import UnsignedNumberExample from 'doc-app/components/docs/ember-input-validation/prefabs/unsigned-number.gts';
+import BasicNumberExample from 'doc-app/components/docs/ember-input-validation/prefabs/basic-number.gts';
+import DisabledNumberExample from 'doc-app/components/docs/ember-input-validation/prefabs/disabled-number.gts';
+import ErrorNumberExample from 'doc-app/components/docs/ember-input-validation/prefabs/error-number.gts';
+import { service } from '@ember/service';
+import CodeExampleComponent from 'doc-app/components/doc/code-example.gts';
+import CodeBlock from 'doc-app/components/doc/code-block.gts';
+import type { Property } from 'doc-app/utils/table-property.interface';
+
+interface NumberPrefabDocsSignature {
+ Args: {
+ model: {
+ properties: Property[];
+ };
+ };
+}
+
+export default class NumberPrefabDocs extends Component {
+ @service declare intl: IntlService;
+
+ unsignedNumberCode = `
+
+ `;
+
+ basicNumberCode = `
+
+ `;
+
+
+
+
+
+ <:demo>
+
+
+ <:template>
+
+
+
+
+
+ <:demo>
+
+
+
+
+
+
+ <:template>
+
+
+
+
+
+
+
+
+
+}
diff --git a/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/password.gts b/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/password.gts
new file mode 100644
index 00000000..d2dd28aa
--- /dev/null
+++ b/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/password.gts
@@ -0,0 +1,62 @@
+import Component from '@glimmer/component';
+import DocPage from 'doc-app/components/doc/page';
+import DocSection from 'doc-app/components/doc/section';
+import DocPropertyTable from 'doc-app/components/doc/property-table';
+import { t, type IntlService } from 'ember-intl';
+import BasicPasswordExample from 'doc-app/components/docs/ember-input-validation/prefabs/basic-password.gts';
+import DisabledPasswordExample from 'doc-app/components/docs/ember-input-validation/prefabs/disabled-password.gts';
+import ErrorPasswordExample from 'doc-app/components/docs/ember-input-validation/prefabs/error-password.gts';
+import { service } from '@ember/service';
+import CodeExampleComponent from 'doc-app/components/doc/code-example.gts';
+import CodeBlock from 'doc-app/components/doc/code-block.gts';
+import type { Property } from 'doc-app/utils/table-property.interface';
+
+interface PasswordPrefabDocsSignature {
+ Args: {
+ model: {
+ properties: Property[];
+ };
+ };
+}
+
+export default class PasswordPrefabDocs extends Component {
+ @service declare intl: IntlService;
+
+ password = `
+
+ `;
+
+
+
+
+
+ <:demo>
+
+
+
+
+
+
+ <:template>
+
+
+
+
+
+
+
+
+
+}
diff --git a/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/radio-group.gts b/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/radio-group.gts
new file mode 100644
index 00000000..de758bd5
--- /dev/null
+++ b/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/radio-group.gts
@@ -0,0 +1,65 @@
+import Component from '@glimmer/component';
+import DocPage from 'doc-app/components/doc/page';
+import DocSection from 'doc-app/components/doc/section';
+import DocPropertyTable from 'doc-app/components/doc/property-table';
+import { t, type IntlService } from 'ember-intl';
+import BasicRadioGroupExample from 'doc-app/components/docs/ember-input-validation/prefabs/basic-radio-group.gts';
+import DisabledRadioGroupExample from 'doc-app/components/docs/ember-input-validation/prefabs/disabled-radio-group.gts';
+import ErrorRadioGroupExample from 'doc-app/components/docs/ember-input-validation/prefabs/error-radio-group.gts';
+import { service } from '@ember/service';
+import CodeExampleComponent from 'doc-app/components/doc/code-example.gts';
+import CodeBlock from 'doc-app/components/doc/code-block.gts';
+import type { Property } from 'doc-app/utils/table-property.interface';
+
+interface RadioGroupPrefabDocsSignature {
+ Args: {
+ model: {
+ properties: Property[];
+ };
+ };
+}
+
+export default class RadioGroupPrefabDocs extends Component {
+ @service declare intl: IntlService;
+
+ radioGroup = `
+
+
+
+
+ `;
+
+
+
+
+
+ <:demo>
+
+
+
+
+
+
+ <:template>
+
+
+
+
+
+
+
+
+
+}
diff --git a/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/radio.gts b/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/radio.gts
new file mode 100644
index 00000000..9b19b159
--- /dev/null
+++ b/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/radio.gts
@@ -0,0 +1,62 @@
+import Component from '@glimmer/component';
+import DocPage from 'doc-app/components/doc/page';
+import DocSection from 'doc-app/components/doc/section';
+import DocPropertyTable from 'doc-app/components/doc/property-table';
+import { t, type IntlService } from 'ember-intl';
+import BasicRadioExample from 'doc-app/components/docs/ember-input-validation/prefabs/basic-radio.gts';
+import DisabledRadioExample from 'doc-app/components/docs/ember-input-validation/prefabs/disabled-radio.gts';
+import ErrorRadioExample from 'doc-app/components/docs/ember-input-validation/prefabs/error-radio.gts';
+import { service } from '@ember/service';
+import CodeExampleComponent from 'doc-app/components/doc/code-example.gts';
+import CodeBlock from 'doc-app/components/doc/code-block.gts';
+import type { Property } from 'doc-app/utils/table-property.interface';
+
+interface RadioPrefabDocsSignature {
+ Args: {
+ model: {
+ properties: Property[];
+ };
+ };
+}
+
+export default class RadioPrefabDocs extends Component {
+ @service declare intl: IntlService;
+
+ radio = `
+
+ `;
+
+
+
+
+
+ <:demo>
+
+
+
+
+
+
+ <:template>
+
+
+
+
+
+
+
+
+
+}
diff --git a/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/select-create.gts b/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/select-create.gts
new file mode 100644
index 00000000..7e83f82d
--- /dev/null
+++ b/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/select-create.gts
@@ -0,0 +1,65 @@
+import Component from '@glimmer/component';
+import DocPage from 'doc-app/components/doc/page';
+import DocSection from 'doc-app/components/doc/section';
+import DocPropertyTable from 'doc-app/components/doc/property-table';
+import { t, type IntlService } from 'ember-intl';
+import BasicSelectCreateExample from 'doc-app/components/docs/ember-input-validation/prefabs/basic-select-create.gts';
+import DisabledSelectCreateExample from 'doc-app/components/docs/ember-input-validation/prefabs/disabled-select-create.gts';
+import ErrorSelectCreateExample from 'doc-app/components/docs/ember-input-validation/prefabs/error-select-create.gts';
+import { service } from '@ember/service';
+import CodeExampleComponent from 'doc-app/components/doc/code-example.gts';
+import CodeBlock from 'doc-app/components/doc/code-block.gts';
+import type { Property } from 'doc-app/utils/table-property.interface';
+
+interface SelectCreatePrefabDocsSignature {
+ Args: {
+ model: {
+ properties: Property[];
+ };
+ };
+}
+
+export default class SelectCreatePrefabDocs extends Component {
+ @service declare intl: IntlService;
+
+ selectCreate = `
+
+ `;
+
+
+
+
+
+ <:demo>
+
+
+
+
+
+
+ <:template>
+
+
+
+
+
+
+
+
+
+}
diff --git a/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/select-search.gts b/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/select-search.gts
new file mode 100644
index 00000000..ee15c03a
--- /dev/null
+++ b/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/select-search.gts
@@ -0,0 +1,65 @@
+import Component from '@glimmer/component';
+import DocPage from 'doc-app/components/doc/page';
+import DocSection from 'doc-app/components/doc/section';
+import DocPropertyTable from 'doc-app/components/doc/property-table';
+import { t, type IntlService } from 'ember-intl';
+import BasicSelectSearchExample from 'doc-app/components/docs/ember-input-validation/prefabs/basic-select-search.gts';
+import DisabledSelectSearchExample from 'doc-app/components/docs/ember-input-validation/prefabs/disabled-select-search.gts';
+import ErrorSelectSearchExample from 'doc-app/components/docs/ember-input-validation/prefabs/error-select-search.gts';
+import { service } from '@ember/service';
+import CodeExampleComponent from 'doc-app/components/doc/code-example.gts';
+import CodeBlock from 'doc-app/components/doc/code-block.gts';
+import type { Property } from 'doc-app/utils/table-property.interface';
+
+interface SelectSearchPrefabDocsSignature {
+ Args: {
+ model: {
+ properties: Property[];
+ };
+ };
+}
+
+export default class SelectSearchPrefabDocs extends Component {
+ @service declare intl: IntlService;
+
+ selectSearch = `
+
+ `;
+
+
+
+
+
+ <:demo>
+
+
+
+
+
+
+ <:template>
+
+
+
+
+
+
+
+
+
+}
diff --git a/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/select.gts b/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/select.gts
new file mode 100644
index 00000000..49b86b36
--- /dev/null
+++ b/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/select.gts
@@ -0,0 +1,62 @@
+import Component from '@glimmer/component';
+import DocPage from 'doc-app/components/doc/page';
+import DocSection from 'doc-app/components/doc/section';
+import DocPropertyTable from 'doc-app/components/doc/property-table';
+import { t, type IntlService } from 'ember-intl';
+import BasicSelectExample from 'doc-app/components/docs/ember-input-validation/prefabs/basic-select.gts';
+import DisabledSelectExample from 'doc-app/components/docs/ember-input-validation/prefabs/disabled-select.gts';
+import ErrorSelectExample from 'doc-app/components/docs/ember-input-validation/prefabs/error-select.gts';
+import { service } from '@ember/service';
+import CodeExampleComponent from 'doc-app/components/doc/code-example.gts';
+import CodeBlock from 'doc-app/components/doc/code-block.gts';
+import type { Property } from 'doc-app/utils/table-property.interface';
+
+interface SelectPrefabDocsSignature {
+ Args: {
+ model: {
+ properties: Property[];
+ };
+ };
+}
+
+export default class SelectPrefabDocs extends Component {
+ @service declare intl: IntlService;
+
+ select = `
+
+ `;
+
+
+
+
+
+ <:demo>
+
+
+
+
+
+
+ <:template>
+
+
+
+
+
+
+
+
+
+}
diff --git a/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/textarea.gts b/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/textarea.gts
new file mode 100644
index 00000000..12476535
--- /dev/null
+++ b/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/textarea.gts
@@ -0,0 +1,62 @@
+import Component from '@glimmer/component';
+import DocPage from 'doc-app/components/doc/page';
+import DocSection from 'doc-app/components/doc/section';
+import DocPropertyTable from 'doc-app/components/doc/property-table';
+import { t, type IntlService } from 'ember-intl';
+import BasicTextareaExample from 'doc-app/components/docs/ember-input-validation/prefabs/basic-textarea.gts';
+import DisabledTextareaExample from 'doc-app/components/docs/ember-input-validation/prefabs/disabled-textarea.gts';
+import ErrorTextareaExample from 'doc-app/components/docs/ember-input-validation/prefabs/error-textarea.gts';
+import { service } from '@ember/service';
+import CodeExampleComponent from 'doc-app/components/doc/code-example.gts';
+import CodeBlock from 'doc-app/components/doc/code-block.gts';
+import type { Property } from 'doc-app/utils/table-property.interface';
+
+interface TextareaPrefabDocsSignature {
+ Args: {
+ model: {
+ properties: Property[];
+ };
+ };
+}
+
+export default class TextareaPrefabDocs extends Component {
+ @service declare intl: IntlService;
+
+ textarea = `
+
+ `;
+
+
+
+
+
+ <:demo>
+
+
+
+
+
+
+ <:template>
+
+
+
+
+
+
+
+
+
+}
diff --git a/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/timepicker.gts b/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/timepicker.gts
new file mode 100644
index 00000000..635d23c1
--- /dev/null
+++ b/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/timepicker.gts
@@ -0,0 +1,61 @@
+import Component from '@glimmer/component';
+import DocPage from 'doc-app/components/doc/page';
+import DocSection from 'doc-app/components/doc/section';
+import DocPropertyTable from 'doc-app/components/doc/property-table';
+import { t, type IntlService } from 'ember-intl';
+import BasicTimepickerExample from 'doc-app/components/docs/ember-input-validation/prefabs/basic-timepicker.gts';
+import DisabledTimepickerExample from 'doc-app/components/docs/ember-input-validation/prefabs/disabled-timepicker.gts';
+import ErrorTimepickerExample from 'doc-app/components/docs/ember-input-validation/prefabs/error-timepicker.gts';
+import { service } from '@ember/service';
+import CodeExampleComponent from 'doc-app/components/doc/code-example.gts';
+import CodeBlock from 'doc-app/components/doc/code-block.gts';
+import type { Property } from 'doc-app/utils/table-property.interface';
+
+interface TimepickerPrefabDocsSignature {
+ Args: {
+ model: {
+ properties: Property[];
+ };
+ };
+}
+
+export default class TimepickerPrefabDocs extends Component {
+ @service declare intl: IntlService;
+
+ timepicker = `
+
+ `;
+
+
+
+
+
+ <:demo>
+
+
+
+
+
+
+ <:template>
+
+
+
+
+
+
+
+
+
+}
diff --git a/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/vat.gts b/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/vat.gts
new file mode 100644
index 00000000..77624de0
--- /dev/null
+++ b/doc-app/app/templates/dashboard/docs/ember-input-validation/prefabs/vat.gts
@@ -0,0 +1,62 @@
+import Component from '@glimmer/component';
+import DocPage from 'doc-app/components/doc/page';
+import DocSection from 'doc-app/components/doc/section';
+import DocPropertyTable from 'doc-app/components/doc/property-table';
+import { t, type IntlService } from 'ember-intl';
+import BasicVatExample from 'doc-app/components/docs/ember-input-validation/prefabs/basic-vat.gts';
+import DisabledVatExample from 'doc-app/components/docs/ember-input-validation/prefabs/disabled-vat.gts';
+import ErrorVatExample from 'doc-app/components/docs/ember-input-validation/prefabs/error-vat.gts';
+import { service } from '@ember/service';
+import CodeExampleComponent from 'doc-app/components/doc/code-example.gts';
+import CodeBlock from 'doc-app/components/doc/code-block.gts';
+import type { Property } from 'doc-app/utils/table-property.interface';
+
+interface VatPrefabDocsSignature {
+ Args: {
+ model: {
+ properties: Property[];
+ };
+ };
+}
+
+export default class VatPrefabDocs extends Component {
+ @service declare intl: IntlService;
+
+ vat = `
+
+ `;
+
+
+
+
+
+ <:demo>
+
+
+
+
+
+
+ <:template>
+
+
+
+
+
+
+
+
+
+}
diff --git a/doc-app/app/templates/dashboard/docs/ember-input/prefabs.gts b/doc-app/app/templates/dashboard/docs/ember-input/prefabs.gts
new file mode 100644
index 00000000..f3b67262
--- /dev/null
+++ b/doc-app/app/templates/dashboard/docs/ember-input/prefabs.gts
@@ -0,0 +1 @@
+{{outlet}}
diff --git a/doc-app/app/templates/dashboard/docs/ember-input/prefabs/button.gts b/doc-app/app/templates/dashboard/docs/ember-input/prefabs/button.gts
new file mode 100644
index 00000000..44768601
--- /dev/null
+++ b/doc-app/app/templates/dashboard/docs/ember-input/prefabs/button.gts
@@ -0,0 +1,56 @@
+import Component from '@glimmer/component';
+import DocPage from 'doc-app/components/doc/page';
+import DocSection from 'doc-app/components/doc/section';
+import DocPropertyTable from 'doc-app/components/doc/property-table';
+import { t, type IntlService } from 'ember-intl';
+import { service } from '@ember/service';
+import CodeExampleComponent from 'doc-app/components/doc/code-example.gts';
+import ButtonExample from 'doc-app/components/docs/ember-input/prefabs/button.gts';
+import DisabledButtonExample from 'doc-app/components/docs/ember-input/prefabs/disabled-button.gts';
+import CodeBlock from 'doc-app/components/doc/code-block.gts';
+import type { Property } from 'doc-app/utils/table-property.interface';
+
+interface ButtonPrefabDocsSignature {
+ Args: {
+ model: {
+ properties: Property[];
+ };
+ };
+}
+
+export default class ButtonPrefabDocs extends Component {
+ @service declare intl: IntlService;
+
+ button = `
+
+ `;
+
+
+
+
+
+ <:demo>
+
+
+
+
+
+ <:template>
+
+
+
+
+
+
+
+
+
+}
diff --git a/doc-app/app/templates/dashboard/docs/ember-input/prefabs/toggle.gts b/doc-app/app/templates/dashboard/docs/ember-input/prefabs/toggle.gts
new file mode 100644
index 00000000..db614fcb
--- /dev/null
+++ b/doc-app/app/templates/dashboard/docs/ember-input/prefabs/toggle.gts
@@ -0,0 +1,53 @@
+import Component from '@glimmer/component';
+import DocPage from 'doc-app/components/doc/page';
+import DocSection from 'doc-app/components/doc/section';
+import DocPropertyTable from 'doc-app/components/doc/property-table';
+import { t, type IntlService } from 'ember-intl';
+import { service } from '@ember/service';
+import CodeExampleComponent from 'doc-app/components/doc/code-example.gts';
+import DisabledToggleExample from 'doc-app/components/docs/ember-input/prefabs/disabled-toggle.gts';
+import ToggleExample from 'doc-app/components/docs/ember-input/prefabs/toggle.gts';
+import CodeBlock from 'doc-app/components/doc/code-block.gts';
+import type { Property } from 'doc-app/utils/table-property.interface';
+
+interface TogglePrefabDocsSignature {
+ Args: {
+ model: {
+ properties: Property[];
+ };
+ };
+}
+
+export default class TogglePrefabDocs extends Component {
+ @service declare intl: IntlService;
+
+ toggle = `
+
+ `;
+
+
+
+
+
+ <:demo>
+
+
+
+
+
+ <:template>
+
+
+
+
+
+
+
+
+
+}
diff --git a/doc-app/app/templates/dashboard/docs/ember-ui/prefabs.gts b/doc-app/app/templates/dashboard/docs/ember-ui/prefabs.gts
new file mode 100644
index 00000000..f3b67262
--- /dev/null
+++ b/doc-app/app/templates/dashboard/docs/ember-ui/prefabs.gts
@@ -0,0 +1 @@
+{{outlet}}
diff --git a/doc-app/app/templates/dashboard/docs/ember-ui/prefabs/confirm-modal.gts b/doc-app/app/templates/dashboard/docs/ember-ui/prefabs/confirm-modal.gts
new file mode 100644
index 00000000..aabd1824
--- /dev/null
+++ b/doc-app/app/templates/dashboard/docs/ember-ui/prefabs/confirm-modal.gts
@@ -0,0 +1,58 @@
+import Component from '@glimmer/component';
+import DocPage from 'doc-app/components/doc/page';
+import DocSection from 'doc-app/components/doc/section';
+import DocPropertyTable from 'doc-app/components/doc/property-table';
+import { t, type IntlService } from 'ember-intl';
+import { service } from '@ember/service';
+import CodeExampleComponent from 'doc-app/components/doc/code-example.gts';
+import CodeBlock from 'doc-app/components/doc/code-block.gts';
+import ConfirmModalExample from 'doc-app/components/docs/ember-ui/prefabs/confirm-modal.gts';
+import type { Property } from 'doc-app/utils/table-property.interface';
+
+interface ConfirmModalPrefabDocsSignature {
+ Args: {
+ model: {
+ properties: Property[];
+ };
+ };
+}
+
+export default class ConfirmModalPrefabDocs extends Component {
+ @service declare intl: IntlService;
+
+ confirmModal = `
+
+ `;
+
+
+
+
+
+ <:demo>
+
+
+
+
+ <:template>
+
+
+
+
+
+
+
+
+
+}
diff --git a/doc-app/app/templates/dashboard/docs/ember-ui/prefabs/table-generic.gts b/doc-app/app/templates/dashboard/docs/ember-ui/prefabs/table-generic.gts
new file mode 100644
index 00000000..fe385a35
--- /dev/null
+++ b/doc-app/app/templates/dashboard/docs/ember-ui/prefabs/table-generic.gts
@@ -0,0 +1,97 @@
+import Component from '@glimmer/component';
+import DocPage from 'doc-app/components/doc/page';
+import DocSection from 'doc-app/components/doc/section';
+import DocPropertyTable from 'doc-app/components/doc/property-table';
+import { t, type IntlService } from 'ember-intl';
+import { service } from '@ember/service';
+import CodeExampleComponent from 'doc-app/components/doc/code-example.gts';
+import CodeBlock from 'doc-app/components/doc/code-block.gts';
+import TpkTableGenericPrefabExample from 'doc-app/components/docs/ember-ui/prefabs/table-generic.gts';
+import type { Property } from 'doc-app/utils/table-property.interface';
+
+interface TpkTableGenericPrefabDocsSignature {
+ Args: {
+ model: {
+ properties: Property[];
+ };
+ };
+}
+
+export default class TpkTableGenericPrefabDocs extends Component {
+ @service declare intl: IntlService;
+
+ tpkTableGenericPrefab = `
+
+ `;
+
+
+
+
+
+ <:demo>
+
+
+ <:template>
+
+
+
+
+
+
+
+
+
+}
diff --git a/doc-app/app/templates/dashboard/docs/ember-ui/prefabs/tpk-form-code-block.ts b/doc-app/app/templates/dashboard/docs/ember-ui/prefabs/tpk-form-code-block.ts
new file mode 100644
index 00000000..e6ad7454
--- /dev/null
+++ b/doc-app/app/templates/dashboard/docs/ember-ui/prefabs/tpk-form-code-block.ts
@@ -0,0 +1,138 @@
+export const tpkForm = `
+
+
+
+
+
+
+
+ Submit
+
+ `;
+
+export const baseComponentsExample = `
+
+
+
+
+ {{#if I.errors}}
+
+ {{#each I.errors as |error|}}
+
{{error.message}}
+ {{/each}}
+
+ {{/if}}
+
+
+ Submit
+
+ `;
+
+export const reactiveValidationExample = `
+
+ {{! Field validates on every change }}
+
+
+ `;
+
+export const submitOnlyValidationExample = `
+
+ {{! Field validates only on submit }}
+
+
+ `;
+
+export const errorHandlingExample = `
+
+ {{! Errors cleared before validation, scrolls to first error }}
+
+
+
+ `;
+
+export const disabledStateExample = `
+
+ {{! All inputs will be disabled when isLoading is true }}
+
+
+ `;
+
+export const requiredFieldsExample = `
+
+ Required fields: {{F.requiredFields.length}}
+
+
+
+ {{#if (includes F.requiredFields "email")}}
+ Email is required
+ {{/if}}
+
+
+ `;
+
+export const changesetGetExample = `
+
+
+
+
+ Full name: {{F.changesetGet "firstName"}} {{F.changesetGet "lastName"}}
+
+ `;
diff --git a/doc-app/app/templates/dashboard/docs/ember-ui/prefabs/tpk-form.gts b/doc-app/app/templates/dashboard/docs/ember-ui/prefabs/tpk-form.gts
new file mode 100644
index 00000000..d4ca656d
--- /dev/null
+++ b/doc-app/app/templates/dashboard/docs/ember-ui/prefabs/tpk-form.gts
@@ -0,0 +1,493 @@
+import Component from '@glimmer/component';
+import DocPage from 'doc-app/components/doc/page';
+import DocSection from 'doc-app/components/doc/section';
+import DocPropertyTable from 'doc-app/components/doc/property-table';
+import { t, type IntlService } from 'ember-intl';
+import { service } from '@ember/service';
+import CodeExampleComponent from 'doc-app/components/doc/code-example.gts';
+import CodeBlock from 'doc-app/components/doc/code-block.gts';
+import TpkFormExample from 'doc-app/components/docs/ember-ui/prefabs/tpk-form.gts';
+import TpkFormBaseComponentsExample from 'doc-app/components/docs/ember-ui/prefabs/tpk-form/base-components.gts';
+import TpkFormReactiveValidationExample from 'doc-app/components/docs/ember-ui/prefabs/tpk-form/reactive-validation.gts';
+import TpkFormSubmitOnlyValidationExample from 'doc-app/components/docs/ember-ui/prefabs/tpk-form/submit-only-validation.gts';
+import TpkFormErrorHandlingExample from 'doc-app/components/docs/ember-ui/prefabs/tpk-form/error-handling.gts';
+import TpkFormDisabledStateExample from 'doc-app/components/docs/ember-ui/prefabs/tpk-form/disabled-state.gts';
+import TpkFormRequiredFieldsExample from 'doc-app/components/docs/ember-ui/prefabs/tpk-form/required-fields.gts';
+import TpkFormChangesetGetExample from 'doc-app/components/docs/ember-ui/prefabs/tpk-form/changeset-get.gts';
+import type { Property } from 'doc-app/utils/table-property.interface';
+import {
+ baseComponentsExample,
+ changesetGetExample,
+ disabledStateExample,
+ errorHandlingExample,
+ reactiveValidationExample,
+ requiredFieldsExample,
+ submitOnlyValidationExample,
+ tpkForm,
+} from './tpk-form-code-block';
+
+interface TpkFormPrefabDocsSignature {
+ Args: {
+ model: {
+ properties: Property[];
+ };
+ };
+}
+
+export default class TpkFormPrefabDocs extends Component {
+ @service declare intl: IntlService;
+
+ baseComponents = [
+ {
+ code: 'F.TpkInput',
+ translate:
+ 'ember-ui.prefabs.tpk-form.sections.yieldedComponents.baseComponents.items.input',
+ htmlSafe: false,
+ },
+ {
+ code: 'F.TpkTextarea',
+ translate:
+ 'ember-ui.prefabs.tpk-form.sections.yieldedComponents.baseComponents.items.textarea',
+ htmlSafe: false,
+ },
+ {
+ code: 'F.TpkSelect',
+ translate:
+ 'ember-ui.prefabs.tpk-form.sections.yieldedComponents.baseComponents.items.select',
+ htmlSafe: false,
+ },
+ {
+ code: 'F.TpkCheckbox',
+ translate:
+ 'ember-ui.prefabs.tpk-form.sections.yieldedComponents.baseComponents.items.checkbox',
+ htmlSafe: false,
+ },
+ {
+ code: 'F.TpkRadio',
+ translate:
+ 'ember-ui.prefabs.tpk-form.sections.yieldedComponents.baseComponents.items.radio',
+ htmlSafe: false,
+ },
+ {
+ code: 'F.TpkRadioGroup',
+ translate:
+ 'ember-ui.prefabs.tpk-form.sections.yieldedComponents.baseComponents.items.radioGroup',
+ htmlSafe: false,
+ },
+ {
+ code: 'F.TpkFile',
+ translate:
+ 'ember-ui.prefabs.tpk-form.sections.yieldedComponents.baseComponents.items.file',
+ htmlSafe: false,
+ },
+ {
+ code: 'F.TpkDatepicker',
+ translate:
+ 'ember-ui.prefabs.tpk-form.sections.yieldedComponents.baseComponents.items.datepicker',
+ htmlSafe: false,
+ },
+ ];
+
+ prefabComponents = [
+ {
+ code: 'F.TpkInputPrefab',
+ translate:
+ 'ember-ui.prefabs.tpk-form.sections.yieldedComponents.prefabComponents.items.input',
+ htmlSafe: false,
+ },
+ {
+ code: 'F.TpkTextareaPrefab',
+ translate:
+ 'ember-ui.prefabs.tpk-form.sections.yieldedComponents.prefabComponents.items.textarea',
+ htmlSafe: false,
+ },
+ {
+ code: 'F.TpkSelectPrefab',
+ translate:
+ 'ember-ui.prefabs.tpk-form.sections.yieldedComponents.prefabComponents.items.select',
+ htmlSafe: false,
+ },
+ {
+ code: 'F.TpkSelectCreatePrefab',
+ translate:
+ 'ember-ui.prefabs.tpk-form.sections.yieldedComponents.prefabComponents.items.selectCreate',
+ htmlSafe: false,
+ },
+ {
+ code: 'F.TpkSelectSearchPrefab',
+ translate:
+ 'ember-ui.prefabs.tpk-form.sections.yieldedComponents.prefabComponents.items.selectSearch',
+ htmlSafe: false,
+ },
+ {
+ code: 'F.TpkCheckboxPrefab',
+ translate:
+ 'ember-ui.prefabs.tpk-form.sections.yieldedComponents.prefabComponents.items.checkbox',
+ htmlSafe: false,
+ },
+ {
+ code: 'F.TpkRadioPrefab',
+ translate:
+ 'ember-ui.prefabs.tpk-form.sections.yieldedComponents.prefabComponents.items.radio',
+ htmlSafe: false,
+ },
+ {
+ code: 'F.TpkRadioGroupPrefab',
+ translate:
+ 'ember-ui.prefabs.tpk-form.sections.yieldedComponents.prefabComponents.items.radioGroup',
+ htmlSafe: false,
+ },
+ {
+ code: 'F.TpkFilePrefab',
+ translate:
+ 'ember-ui.prefabs.tpk-form.sections.yieldedComponents.prefabComponents.items.file',
+ htmlSafe: false,
+ },
+ ];
+
+ specializedInputs = [
+ {
+ code: 'F.TpkPasswordPrefab',
+ translate:
+ 'ember-ui.prefabs.tpk-form.sections.yieldedComponents.specializedInputs.items.password',
+ htmlSafe: false,
+ },
+ {
+ code: 'F.TpkEmailPrefab',
+ translate:
+ 'ember-ui.prefabs.tpk-form.sections.yieldedComponents.specializedInputs.items.email',
+ htmlSafe: false,
+ },
+ {
+ code: 'F.TpkMobilePrefab',
+ translate:
+ 'ember-ui.prefabs.tpk-form.sections.yieldedComponents.specializedInputs.items.mobile',
+ htmlSafe: false,
+ },
+ {
+ code: 'F.TpkIbanPrefab',
+ translate:
+ 'ember-ui.prefabs.tpk-form.sections.yieldedComponents.specializedInputs.items.iban',
+ htmlSafe: false,
+ },
+ {
+ code: 'F.TpkBicPrefab',
+ translate:
+ 'ember-ui.prefabs.tpk-form.sections.yieldedComponents.specializedInputs.items.bic',
+ htmlSafe: false,
+ },
+ {
+ code: 'F.TpkVatPrefab',
+ translate:
+ 'ember-ui.prefabs.tpk-form.sections.yieldedComponents.specializedInputs.items.vat',
+ htmlSafe: false,
+ },
+ {
+ code: 'F.TpkNationalNumberPrefab',
+ translate:
+ 'ember-ui.prefabs.tpk-form.sections.yieldedComponents.specializedInputs.items.nationalNumber',
+ htmlSafe: false,
+ },
+ {
+ code: 'F.TpkCurrencyPrefab',
+ translate:
+ 'ember-ui.prefabs.tpk-form.sections.yieldedComponents.specializedInputs.items.currency',
+ htmlSafe: false,
+ },
+ {
+ code: 'F.TpkIntegerPrefab',
+ translate:
+ 'ember-ui.prefabs.tpk-form.sections.yieldedComponents.specializedInputs.items.integer',
+ htmlSafe: false,
+ },
+ {
+ code: 'F.TpkNumberPrefab',
+ translate:
+ 'ember-ui.prefabs.tpk-form.sections.yieldedComponents.specializedInputs.items.number',
+ htmlSafe: false,
+ },
+ ];
+
+ dateTimeComponents = [
+ {
+ code: 'F.TpkDatepickerPrefab',
+ translate:
+ 'ember-ui.prefabs.tpk-form.sections.yieldedComponents.dateTime.items.datepicker',
+ htmlSafe: false,
+ },
+ {
+ code: 'F.TpkDatepickerRangePrefab',
+ translate:
+ 'ember-ui.prefabs.tpk-form.sections.yieldedComponents.dateTime.items.datepickerRange',
+ htmlSafe: false,
+ },
+ {
+ code: 'F.TpkTimepickerPrefab',
+ translate:
+ 'ember-ui.prefabs.tpk-form.sections.yieldedComponents.dateTime.items.timepicker',
+ htmlSafe: false,
+ },
+ ];
+
+ helpers = [
+ {
+ code: 'F.changesetGet',
+ translate:
+ 'ember-ui.prefabs.tpk-form.sections.yieldedComponents.helpers.items.changesetGet',
+ htmlSafe: true,
+ },
+ {
+ code: 'F.requiredFields',
+ translate:
+ 'ember-ui.prefabs.tpk-form.sections.yieldedComponents.helpers.items.requiredFields',
+ htmlSafe: false,
+ },
+ ];
+
+ get componentSections() {
+ return [
+ {
+ titleKey:
+ 'ember-ui.prefabs.tpk-form.sections.yieldedComponents.baseComponents.title',
+ items: this.baseComponents,
+ },
+ {
+ titleKey:
+ 'ember-ui.prefabs.tpk-form.sections.yieldedComponents.prefabComponents.title',
+ items: this.prefabComponents,
+ },
+ {
+ titleKey:
+ 'ember-ui.prefabs.tpk-form.sections.yieldedComponents.specializedInputs.title',
+ items: this.specializedInputs,
+ },
+ {
+ titleKey:
+ 'ember-ui.prefabs.tpk-form.sections.yieldedComponents.dateTime.title',
+ items: this.dateTimeComponents,
+ },
+ {
+ titleKey:
+ 'ember-ui.prefabs.tpk-form.sections.yieldedComponents.helpers.title',
+ items: this.helpers,
+ },
+ ];
+ }
+
+
+
+
+
+ <:demo>
+
+
+
+
+ <:template>
+
+
+
+
+
+
+ {{t
+ "ember-ui.prefabs.tpk-form.sections.yieldedComponents.description"
+ }}
+
+ {{#each this.componentSections as |section|}}
+
+
{{t section.titleKey}}
+
+ {{#each section.items as |item|}}
+ {{item.code}}
+ -
+ {{t item.translate htmlSafe=item.htmlSafe}}
+
+ {{/each}}
+
+
+ {{/each}}
+
+
+
+
+ {{t
+ "ember-ui.prefabs.tpk-form.sections.usingBaseComponents.description"
+ }}
+
+ <:demo>
+
+
+
+
+ <:template>
+
+
+
+
+
+
+
+
+
{{t
+ "ember-ui.prefabs.tpk-form.sections.validationBehavior.reactive.title"
+ }}
+
{{t
+ "ember-ui.prefabs.tpk-form.sections.validationBehavior.reactive.description"
+ }}
+
+ <:demo>
+
+
+
+
+ <:template>
+
+
+
+
+
+
+
{{t
+ "ember-ui.prefabs.tpk-form.sections.validationBehavior.submitOnly.title"
+ }}
+
{{t
+ "ember-ui.prefabs.tpk-form.sections.validationBehavior.submitOnly.description"
+ }}
+
+ <:demo>
+
+
+
+
+ <:template>
+
+
+
+
+
+
+
+
+ {{t
+ "ember-ui.prefabs.tpk-form.sections.errorHandling.description"
+ }}
+
+ <:demo>
+
+
+
+
+ <:template>
+
+
+
+
+
+
+ {{t
+ "ember-ui.prefabs.tpk-form.sections.disabledState.description"
+ }}
+
+ <:demo>
+
+
+
+
+ <:template>
+
+
+
+
+
+
+ {{t
+ "ember-ui.prefabs.tpk-form.sections.requiredFields.description"
+ }}
+
+ <:demo>
+
+
+
+
+ <:template>
+
+
+
+
+
+
+ {{t
+ "ember-ui.prefabs.tpk-form.sections.changesetGetHelper.description"
+ }}
+
+ <:demo>
+
+
+ <:template>
+
+
+
+
+
+
+
+
+
+
+}
diff --git a/doc-app/app/templates/docs.hbs b/doc-app/app/templates/docs.hbs
deleted file mode 100644
index c10e510a..00000000
--- a/doc-app/app/templates/docs.hbs
+++ /dev/null
@@ -1,139 +0,0 @@
-{{! @glint-ignore }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{! prefab section }}
-
- {{! validation section }}
- {{!
-
-
-
-
-
-
-
- }}
-
- {{! form section }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{! input section }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{outlet}}
-
-
\ No newline at end of file
diff --git a/doc-app/app/templates/docs/ember-input-validation/prefabs/checkbox.md b/doc-app/app/templates/docs/ember-input-validation/prefabs/checkbox.md
deleted file mode 100644
index b56955f2..00000000
--- a/doc-app/app/templates/docs/ember-input-validation/prefabs/checkbox.md
+++ /dev/null
@@ -1,43 +0,0 @@
-# Checkbox
-
-This component provides a checkbox.
-
-
-
-
-
-
-
-
-
-
-
-## Mandatory properties
-
-- `@validationField`: The field name in the changeset for validation.
-- `@changeset`: The changeset object for form validation.
-
-## Optional properties
-
-- `@label`: The label for the input field.
-- `@disabled`: Whether the input field is disabled.
-- `@mandatory`: Whether the textarea field is mandatory.
-- `@onChange`: The action to be called when the selection changes.
-- `@changeEvent`: The event to trigger the onChange action.
diff --git a/doc-app/app/templates/docs/ember-input-validation/prefabs/email.md b/doc-app/app/templates/docs/ember-input-validation/prefabs/email.md
deleted file mode 100644
index 7b64c4f8..00000000
--- a/doc-app/app/templates/docs/ember-input-validation/prefabs/email.md
+++ /dev/null
@@ -1,40 +0,0 @@
-# Input Email
-
-This is an input with type Email
-
-
-
-
-
-
-
-
-
-
-## Mandatory properties
-
-- `@validationField`: The field name in the changeset for validation.
-- `@changeset`: The changeset object for form validation.
-
-## Optional properties
-
-- `@label`: The label for the input field.
-- `@disabled`: Whether the input field is disabled.
-- `@mandatory`: Whether the textarea field is mandatory.
-- `@onChange`: The action to be called when the selection changes.
-- `@changeEvent`: The event to trigger the onChange action.
\ No newline at end of file
diff --git a/doc-app/app/templates/docs/ember-input-validation/prefabs/file-list.md b/doc-app/app/templates/docs/ember-input-validation/prefabs/file-list.md
deleted file mode 100644
index e0c71056..00000000
--- a/doc-app/app/templates/docs/ember-input-validation/prefabs/file-list.md
+++ /dev/null
@@ -1,43 +0,0 @@
-# Input File
-
-This is an input with a dropzone that allows to upload multiple files. You can also find a list of uploaded files and dowload/delete theme.
-
-
-
-
-
-
-
-
-
-
-## Mandatory properties
-
-- `@validationField`: The field name in the changeset for validation.
-- `@changeset`: The changeset object for form validation.
-
-## Optional properties
-
-- `@label`: The label for the input field.
-- `@disabled`: Whether the input field is disabled.
-- `@mandatory`: Whether the input file multiple field is mandatory.
-- `@onChange`: The action to be called when the selection changes.
-- `@disableDownload`: Whether the download button is disabled.
-- `@placeholder`: The placeholder for the dropzone area.
diff --git a/doc-app/app/templates/docs/ember-input-validation/prefabs/file.md b/doc-app/app/templates/docs/ember-input-validation/prefabs/file.md
deleted file mode 100644
index 704ae577..00000000
--- a/doc-app/app/templates/docs/ember-input-validation/prefabs/file.md
+++ /dev/null
@@ -1,41 +0,0 @@
-# Input File
-
-This is an input with type File
-
-
-
-
-
-
-
-
-
-
-## Mandatory properties
-
-- `@validationField`: The field name in the changeset for validation.
-- `@changeset`: The changeset object for form validation.
-
-## Optional properties
-
-- `@label`: The label for the input field.
-- `@disabled`: Whether the input field is disabled.
-- `@mandatory`: Whether the textarea field is mandatory.
-- `@onChange`: The action to be called when the selection changes.
-- `@changeEvent`: The event to trigger the onChange action.
diff --git a/doc-app/app/templates/docs/ember-input-validation/prefabs/integer.md b/doc-app/app/templates/docs/ember-input-validation/prefabs/integer.md
deleted file mode 100644
index 7b9e9102..00000000
--- a/doc-app/app/templates/docs/ember-input-validation/prefabs/integer.md
+++ /dev/null
@@ -1,45 +0,0 @@
-# Integer
-
-The integer validation input prefab is used when an integer input is required.
-
-It prevents decimal numbers by disallowing the comma and period.
-
-The integer validation input can be restricted to a minimum of 0 or allow negative numbers.
-
-
-
-
-
-
-
-
-
-
diff --git a/doc-app/app/templates/docs/ember-input-validation/prefabs/national-number.md b/doc-app/app/templates/docs/ember-input-validation/prefabs/national-number.md
deleted file mode 100644
index 7928f03d..00000000
--- a/doc-app/app/templates/docs/ember-input-validation/prefabs/national-number.md
+++ /dev/null
@@ -1,32 +0,0 @@
-# Input national number
-
-This is an input with a built-in mask for a belgian national number.
-It makes so that the national number is written in a pretty format similar
-to the one on your belgian ID.
-
-
-
-
-
-
-
-
-
-
-
diff --git a/doc-app/app/templates/docs/ember-input-validation/prefabs/number.md b/doc-app/app/templates/docs/ember-input-validation/prefabs/number.md
deleted file mode 100644
index 4bdbcf63..00000000
--- a/doc-app/app/templates/docs/ember-input-validation/prefabs/number.md
+++ /dev/null
@@ -1,51 +0,0 @@
-# Number
-
-The number validation input can be blocked at a minimum of 0 or be a negative number
-
-
-
-
-
-
-
-
-
-
diff --git a/doc-app/app/templates/docs/ember-input-validation/prefabs/password.md b/doc-app/app/templates/docs/ember-input-validation/prefabs/password.md
deleted file mode 100644
index 312abeea..00000000
--- a/doc-app/app/templates/docs/ember-input-validation/prefabs/password.md
+++ /dev/null
@@ -1,35 +0,0 @@
-# Input password
-
-This is a password input field.
-
-
-
-
-
-
-
-
-
-
diff --git a/doc-app/app/templates/docs/ember-input-validation/prefabs/select-search.md b/doc-app/app/templates/docs/ember-input-validation/prefabs/select-search.md
deleted file mode 100644
index 1f9960a7..00000000
--- a/doc-app/app/templates/docs/ember-input-validation/prefabs/select-search.md
+++ /dev/null
@@ -1,111 +0,0 @@
-# Select Search
-
-This component provides a powerfull select with search and has built-in validation. It uses [ember-power-select](https://ember-power-select.com/).
-
-It uses also toString() in order to display the options and the selected element.
-
-In example:
-
-```ts
- options = [
- { label: 'Option 1', value: 'option-1', toString() { return `${this.label}`; } }
- ];
-```
-
-
-
-
-
-
-
-
-
-
-## Mandatory properties
-
-- `@validationField`: The field name in the changeset for validation.
-- `@changeset`: The changeset object for form validation.
-- `@options`: The options to display in the select dropdown.
-- `@onSearch`: The action to be called when user's typing in the input.
-
-## Optional properties
-
-- `@label`: The label for the input field.
-- `@placeholder`: The placeholder text for the input field.
-- `@disabled`: Whether the input field is disabled.
-- `@multiple`: Whether multiple selections are allowed.
-- `@initiallyOpened`: Whether the select dropdown is initially opened.
-- `@mandatory`: Whether the textarea field is mandatory.
-- `@allowClear`: Whether to show a button to clear the selection.
-- `@onChange`: The action to be called when the selection changes.
-- `@labelComponent`: The custom component to use for the label.
-- `@selectedItemComponent`: The custom component to use for the selected item.
-- `@placeholderComponent`: The custom component to use for the placeholder
-- `@searchPlaceholder`: The placeholder text for the search input.
-- `@searchMessage`: Message shown in options list when no search has been entered and there are no options.
-- `@loadingMessage`: Message shown in options list when loading options.
-- `@noMatchesMessage`: Message shown in options list when no matches are found.
-
-## Examples
-
-### Select Search multiple with allowClear
-
-
-
-
-
-
-
-
-### Select Search with all label translate and initially opened
-
-
-
-
-
-
-
diff --git a/doc-app/app/templates/docs/ember-input-validation/prefabs/select.md b/doc-app/app/templates/docs/ember-input-validation/prefabs/select.md
deleted file mode 100644
index 580115ea..00000000
--- a/doc-app/app/templates/docs/ember-input-validation/prefabs/select.md
+++ /dev/null
@@ -1,136 +0,0 @@
-# Select
-
-This component provides a powerfull select with multitude features and has built-in validation. It uses [ember-power-select](https://ember-power-select.com/).
-
-It uses also toString() in order to display the options and the selected element.
-
-In example:
-
-```ts
- options = [
- { label: 'Option 1', value: 'option-1', toString() { return `${this.label}`; } }
- ];
-```
-
-
-
-
-
-
-
-
-
-
-## Mandatory properties
-
-- `@validationField`: The field name in the changeset for validation.
-- `@changeset`: The changeset object for form validation.
-- `@options`: The options to display in the select dropdown.
-
-## Optional properties
-
-- `@label`: The label for the input field.
-- `@placeholder`: The placeholder text for the input field.
-- `@disabled`: Whether the input field is disabled.
-- `@multiple`: Whether multiple selections are allowed.
-- `@mandatory`: Whether the textarea field is mandatory.
-- `@initiallyOpened`: Whether the select dropdown is initially opened.
-- `@allowClear`: Whether to show a button to clear the selection.
-- `@onChange`: The action to be called when the selection changes.
-- `@labelComponent`: The custom component to use for the label.
-- `@selectedItemComponent`: The custom component to use for the selected item.
-- `@placeholderComponent`: The custom component to use for the placeholder
-
-## Examples
-
-### Select multiple
-
-
-
-
-
-
-
-
-### Select with specific component for label
-
-
-
-
-
-
-
-
-
-
-
-### Select with allowClear
-
-
-
-
-
-
-
-
-### Select initially opened
-
-
-
-
-
-
-
diff --git a/doc-app/app/templates/docs/ember-input-validation/prefabs/textarea.md b/doc-app/app/templates/docs/ember-input-validation/prefabs/textarea.md
deleted file mode 100644
index a1b4c3f0..00000000
--- a/doc-app/app/templates/docs/ember-input-validation/prefabs/textarea.md
+++ /dev/null
@@ -1,58 +0,0 @@
-# Textarea
-
-This component provides an textarea.
-
-
-
-
-
-
-
-
-
-
-## Mandatory properties
-
-- `@validationField`: The field name in the changeset for validation.
-- `@changeset`: The changeset object for form validation.
-
-## Optional properties
-
-- `@label`: The label for the textarea field.
-- `@placeholder`: The placeholder text for the textarea field.
-- `@mandatory`: Whether the textarea field is mandatory.
-- `@disabled`: Whether the input field is disabled.
-- `@onChange`: The action to be called when the selection changes.
-- `@changeEvent`: The event to trigger the onChange action.
-- `@maxLength`: The maximum length of the textarea field.
-
-## Examples
-
-### Textarea with maxLength
-
-
-
-
-
-
-
diff --git a/doc-app/app/templates/docs/ember-input/button.md b/doc-app/app/templates/docs/ember-input/button.md
deleted file mode 100644
index 50e493d6..00000000
--- a/doc-app/app/templates/docs/ember-input/button.md
+++ /dev/null
@@ -1,28 +0,0 @@
-# Ember input/button
-
-A button component that performs an onClick task.
-
-By default, prevents spam click by waiting the current task to finish before accepting a new one.
-
-
-
-
- Spam me @allowSpam={{true}}
-
-
- Spam me @allowSpam={{false}}
-
-
- Counter : {{this.counter}}
-
-
-
-
-
diff --git a/doc-app/app/templates/docs/ember-input/checkbox.md b/doc-app/app/templates/docs/ember-input/checkbox.md
deleted file mode 100644
index 05cfca71..00000000
--- a/doc-app/app/templates/docs/ember-input/checkbox.md
+++ /dev/null
@@ -1,21 +0,0 @@
-# Ember input/checkbox
-
-A composable checkbox input element.
-
-
-
-
-
-
-
-
- Checked: {{this.checked}}
-
-
-
-
-
diff --git a/doc-app/app/templates/docs/ember-input/file.md b/doc-app/app/templates/docs/ember-input/file.md
deleted file mode 100644
index 6c2248bf..00000000
--- a/doc-app/app/templates/docs/ember-input/file.md
+++ /dev/null
@@ -1,49 +0,0 @@
-# Ember input/file
-
-The **TpkFileInputComponent** is designed to handle file input in a web application. It encapsulates an HTML file field (`
-
-
-
-
-
-
-
-
-
-**Multiple input/file**
-
-
-
-
-
-
-
-
-
-
-## Arguments description
-
-- **accept?: string**
- - This argument is optional and expects a string. It specifies the file types the user can select. For example, "image/*" will accept all image types.
-- **disabled?: boolean**
- - This argument is optional and is a boolean. If it is supplied and evaluates to true, the file field will be disabled. Otherwise, it will be enabled.
-- **multiple?: boolean**
- - This argument is optional and is a boolean. If provided and evaluated to true, the file field will allow the user to select multiple files at once. Otherwise, only one file can be selected.
-- **changeEvent: 'input' | 'change'**
- - This argument is mandatory and must be one of two string values: 'input' or 'change'. It specifies the type of change event associated with the file input field. This can be useful to customize when the onChange callback function is triggered.
-- **onChange: (event: Event) => void**
- - This argument is mandatory and waits for a callback function that takes an argument of type Event. This callback function will be called when the specified change event ('input' or 'change') occurs on the file field. It can be used to perform actions in response to file changes.
diff --git a/doc-app/app/templates/docs/ember-input/input.md b/doc-app/app/templates/docs/ember-input/input.md
deleted file mode 100644
index 708a7367..00000000
--- a/doc-app/app/templates/docs/ember-input/input.md
+++ /dev/null
@@ -1,23 +0,0 @@
-# Ember input/input
-
-A composable html input element.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Value: {{this.value}}
-
-
-
-
-
diff --git a/doc-app/app/templates/docs/ember-input/prefabs/button.md b/doc-app/app/templates/docs/ember-input/prefabs/button.md
deleted file mode 100644
index 29bc2b40..00000000
--- a/doc-app/app/templates/docs/ember-input/prefabs/button.md
+++ /dev/null
@@ -1,27 +0,0 @@
-# Button
-
-A button. This is a simple wrapper around the `input` element with `type="button"`.
-
-
-
-
- count = {{this.counter}}
-
-
-
-
-## Mandatory properties
-
-- `@label`: The label for the button field.
-- `@onClick`: The action to be called when the button clicked.
-
-## Optional properties
-
-- `@disabled`: Whether the button field is disabled.
-
-## Important
-
-- `class`: To create a custom class you must do it in a CSS file to override the button class
\ No newline at end of file
diff --git a/doc-app/app/templates/docs/ember-input/prefabs/toggle.md b/doc-app/app/templates/docs/ember-input/prefabs/toggle.md
deleted file mode 100644
index 9e7f0d83..00000000
--- a/doc-app/app/templates/docs/ember-input/prefabs/toggle.md
+++ /dev/null
@@ -1,12 +0,0 @@
-# Toggle
-
-A toggle switch. This is a simple wrapper around the `input` element with `type="checkbox"`.
-
-
-
-
-
-
-
-
-
diff --git a/doc-app/app/templates/docs/ember-ui/actions-menu.md b/doc-app/app/templates/docs/ember-ui/actions-menu.md
deleted file mode 100644
index 316be63f..00000000
--- a/doc-app/app/templates/docs/ember-ui/actions-menu.md
+++ /dev/null
@@ -1,17 +0,0 @@
-# Actions menu
-
-A component for a tooltip-like actions menu.
-
-
-
-
-
- Edit
-
-
-
-
-
\ No newline at end of file
diff --git a/doc-app/app/templates/docs/ember-ui/modal.md b/doc-app/app/templates/docs/ember-ui/modal.md
deleted file mode 100644
index 405f9ca4..00000000
--- a/doc-app/app/templates/docs/ember-ui/modal.md
+++ /dev/null
@@ -1,25 +0,0 @@
-# Modal
-
-A modal component.
-
-
-
-
- Open the modal
-
-
-
-
-
- Click outside to close
- Focusable element
-
-
-
-
-
diff --git a/doc-app/app/templates/docs/ember-ui/prefabs/confirm-modal.md b/doc-app/app/templates/docs/ember-ui/prefabs/confirm-modal.md
deleted file mode 100644
index b868071e..00000000
--- a/doc-app/app/templates/docs/ember-ui/prefabs/confirm-modal.md
+++ /dev/null
@@ -1,31 +0,0 @@
-# Modal
-
-A modal component.
-
-
-
-
- Open the modal
-
-
-
-
-
-
-## Mandatory properties
-
-- `@onClose`: this is a function to close modal.
-- `@onConfirm`: this is a function to close modal.
-- `@cancelText`: this is a string to populate cancel button
-- `@confirmText`: this is a string to populate confirm button
-- `@confirmQuestion`: this is the text of confirmation to user
-- `@isOpen` : boolean to close modal
\ No newline at end of file
diff --git a/doc-app/app/templates/docs/ember-ui/table-generic.md b/doc-app/app/templates/docs/ember-ui/table-generic.md
deleted file mode 100644
index 2b106c90..00000000
--- a/doc-app/app/templates/docs/ember-ui/table-generic.md
+++ /dev/null
@@ -1,47 +0,0 @@
-# Table generic
-
-A table component.
-
-
-
-
-
-
-
-
- Firstname
-
-
- Lastname
-
-
- Email
-
-
-
-
- {{element.firstName}}
-
-
- {{element.lastName}}
-
-
- {{element.email}}
-
-
-
- Delete
-
-
-
-
-
-
-
-
-
diff --git a/doc-app/app/templates/forgot-password.gts b/doc-app/app/templates/forgot-password.gts
new file mode 100644
index 00000000..8327bc95
--- /dev/null
+++ b/doc-app/app/templates/forgot-password.gts
@@ -0,0 +1,24 @@
+import { LinkTo } from '@ember/routing';
+import Component from '@glimmer/component';
+import TpkForgotPasswordForm from '@triptyk/ember-ui/components/prefabs/tpk-forgot-password';
+import { email, object } from 'zod';
+import AuthLayout from 'doc-app/components/auth-layout.gts';
+
+export default class ForgotPasswordTemplate extends Component {
+ forgotPasswordValidationSchema = object({
+ email: email(),
+ });
+
+ onSubmit = async () => {};
+
+
+ Forgot password
+
+ Back to login
+
+
+}
diff --git a/doc-app/app/templates/home.gts b/doc-app/app/templates/home.gts
new file mode 100644
index 00000000..89d3f40b
--- /dev/null
+++ b/doc-app/app/templates/home.gts
@@ -0,0 +1,181 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { action } from '@ember/object';
+import { service } from '@ember/service';
+import TpkDashBoard, {
+ type SidebarItem,
+ type Language,
+} from '@triptyk/ember-ui/components/prefabs/tpk-dashboard';
+import type { TOC } from '@ember/component/template-only';
+import ThemeSelector from 'doc-app/components/theme-selector';
+import { hash } from '@ember/helper';
+import type { IntlService } from 'ember-intl';
+
+export default class DashboardTemplate extends Component {
+ @service declare intl: IntlService;
+ @tracked sidebarCollapsed = false;
+
+ languages: Language[] = [
+ { code: 'fr-fr', label: 'Français' },
+ { code: 'en-us', label: 'Anglais' },
+ ];
+
+ @action
+ logout() {
+ console.log('logout');
+ }
+ @action
+ handleCollapsedChange(collapsed: boolean) {
+ this.sidebarCollapsed = collapsed;
+ }
+
+ @action
+ toggleSidebar() {
+ this.sidebarCollapsed = !this.sidebarCollapsed;
+ }
+
+ @action
+ handleLocaleChange(locale: string) {
+ this.intl.setLocale([locale]);
+ }
+
+ menuItems: SidebarItem[] = [
+ {
+ type: 'link',
+ label: 'Accueil',
+ route: 'home',
+ icon:
+
+
+
+ as TOC<{ Element: SVGSVGElement }>,
+ },
+ {
+ type: 'link',
+ label: 'Commandes',
+ route: 'dashboard.docs.ember-input-validation.prefabs.input',
+ icon:
+
+
+
+ as TOC<{ Element: SVGSVGElement }>,
+ },
+ {
+ type: 'link',
+ label: 'Notifications',
+ route: 'dashboard.docs.ember-input-validation.prefabs.input',
+ icon:
+
+
+
+ as TOC<{ Element: SVGSVGElement }>,
+ },
+ {
+ type: 'link',
+ label: 'Paramètres',
+ route: 'dashboard.docs.ember-input-validation.prefabs.input',
+ icon:
+
+
+
+
+ as TOC<{ Element: SVGSVGElement }>,
+ },
+ ];
+
+
+
+
+ <:header>
+
+
+ {{#unless this.sidebarCollapsed}}
+
EMBER COMMON UI
+ {{/unless}}
+
+
+ <:content>
+
+ {{outlet}}
+
+
+ <:footer>
+
+
+
+
+ <:menu>
+
+
+ Synchronisation
+
+
+
+
+
+
+}
diff --git a/doc-app/app/templates/index.hbs b/doc-app/app/templates/index.hbs
deleted file mode 100644
index 375238a3..00000000
--- a/doc-app/app/templates/index.hbs
+++ /dev/null
@@ -1,2 +0,0 @@
-{{!-- @glint-ignore --}}
-
\ No newline at end of file
diff --git a/doc-app/app/templates/login.gts b/doc-app/app/templates/login.gts
new file mode 100644
index 00000000..7e315a09
--- /dev/null
+++ b/doc-app/app/templates/login.gts
@@ -0,0 +1,26 @@
+import { LinkTo } from '@ember/routing';
+import Component from '@glimmer/component';
+import TpkLoginForm from '@triptyk/ember-ui/components/prefabs/tpk-login';
+import AuthLayout from 'doc-app/components/auth-layout.gts';
+import { email, object, string } from 'zod';
+
+export default class LoginTemplate extends Component {
+ loginValidationSchema = object({
+ email: email(),
+ password: string().min(8, 'Should be at least 8 characters'),
+ });
+
+ onSubmit = async () => {};
+
+
+ Sign in
+
+ Forgot
+ password?
+
+
+}
diff --git a/doc-app/app/templates/reset-password.gts b/doc-app/app/templates/reset-password.gts
new file mode 100644
index 00000000..c81dddf1
--- /dev/null
+++ b/doc-app/app/templates/reset-password.gts
@@ -0,0 +1,47 @@
+import { LinkTo } from '@ember/routing';
+import Component from '@glimmer/component';
+import TpkResetPasswordForm from '@triptyk/ember-ui/components/prefabs/tpk-reset-password';
+import { object, string } from 'zod';
+import AuthLayout from 'doc-app/components/auth-layout.gts';
+import type RouterService from '@ember/routing/router-service';
+import { service } from '@ember/service';
+import type Owner from '@ember/owner';
+import { assert } from '@ember/debug';
+
+export interface ResetPasswordTemplateSignature {
+ Args: object;
+ Blocks: {
+ default: [];
+ };
+ Element: HTMLDivElement;
+}
+
+export default class ResetPasswordTemplate extends Component {
+ @service declare router: RouterService;
+ declare token: string;
+
+ constructor(owner: Owner, args: ResetPasswordTemplateSignature['Args']) {
+ super(owner, args);
+ assert('Token is required', this.router.currentRoute?.queryParams?.token);
+ this.token = this.router.currentRoute?.queryParams?.token as string;
+ }
+
+ resetPasswordValidationSchema = object({
+ password: string().min(8, 'Should be at least 8 characters'),
+ confirmPassword: string().min(8, 'Should be at least 8 characters'),
+ });
+
+ onSubmit = async () => {};
+
+
+
+ Reset password
+
+ Back to login
+
+
+}
diff --git a/doc-app/app/utils/table-property.interface.ts b/doc-app/app/utils/table-property.interface.ts
new file mode 100644
index 00000000..216ec960
--- /dev/null
+++ b/doc-app/app/utils/table-property.interface.ts
@@ -0,0 +1,6 @@
+export interface Property {
+ name: string;
+ type: string;
+ required: boolean;
+ description: string;
+}
diff --git a/doc-app/babel.config.cjs b/doc-app/babel.config.cjs
new file mode 100644
index 00000000..94441e95
--- /dev/null
+++ b/doc-app/babel.config.cjs
@@ -0,0 +1,53 @@
+'use strict';
+
+const {
+ babelCompatSupport,
+ templateCompatSupport,
+} = require('@embroider/compat/babel');
+
+module.exports = {
+ plugins: [
+ ['ember-concurrency/async-arrow-task-transform', {}],
+ [
+ '@babel/plugin-transform-typescript',
+ {
+ allExtensions: true,
+ onlyRemoveTypeImports: true,
+ allowDeclareFields: true,
+ },
+ ],
+ [
+ 'babel-plugin-ember-template-compilation',
+ {
+ compilerPath: 'ember-source/dist/ember-template-compiler.js',
+ enableLegacyModules: [
+ 'ember-cli-htmlbars',
+ 'ember-cli-htmlbars-inline-precompile',
+ 'htmlbars-inline-precompile',
+ ],
+ transforms: [...templateCompatSupport()],
+ },
+ ],
+ [
+ 'module:decorator-transforms',
+ {
+ runtime: {
+ import: require.resolve('decorator-transforms/runtime-esm'),
+ },
+ },
+ ],
+ [
+ '@babel/plugin-transform-runtime',
+ {
+ absoluteRuntime: __dirname,
+ useESModules: true,
+ regenerator: false,
+ },
+ ],
+ ...babelCompatSupport(),
+ ],
+
+ generatorOpts: {
+ compact: false,
+ },
+};
diff --git a/doc-app/config/addon-docs.js b/doc-app/config/addon-docs.js
deleted file mode 100644
index 83551f59..00000000
--- a/doc-app/config/addon-docs.js
+++ /dev/null
@@ -1,9 +0,0 @@
-/* eslint-env node */
-
-
-const AddonDocsConfig = require('ember-cli-addon-docs/lib/config');
-
-module.exports = class extends AddonDocsConfig {
- // See https://ember-learn.github.io/ember-cli-addon-docs/docs/deploying
- // for details on configuration you can override here.
-};
diff --git a/doc-app/config/deploy.js b/doc-app/config/deploy.js
deleted file mode 100644
index ff6a2ce3..00000000
--- a/doc-app/config/deploy.js
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-module.exports = function () {
- let ENV = {
- pipeline: {
- disabled: {
- 'ember-cli-addon-docs': true,
- },
- },
- };
-
- return ENV;
-};
diff --git a/doc-app/config/ember-cli-update.json b/doc-app/config/ember-cli-update.json
index 0573703e..90f88e59 100644
--- a/doc-app/config/ember-cli-update.json
+++ b/doc-app/config/ember-cli-update.json
@@ -2,16 +2,14 @@
"schemaVersion": "1.0.0",
"packages": [
{
- "name": "ember-cli",
- "version": "5.12.0",
+ "name": "@ember/app-blueprint",
+ "version": "6.9.1",
"blueprints": [
{
- "name": "app",
- "outputRepo": "https://github.com/ember-cli/ember-new-output",
- "codemodsSource": "ember-app-codemods-manifest@1",
+ "name": "@ember/app-blueprint",
"isBaseBlueprint": true,
"options": [
- "--embroider",
+ "--pnpm",
"--ci-provider=github",
"--typescript"
]
diff --git a/doc-app/config/ember-intl.js b/doc-app/config/ember-intl.js
deleted file mode 100644
index 1f01ccbc..00000000
--- a/doc-app/config/ember-intl.js
+++ /dev/null
@@ -1,93 +0,0 @@
-module.exports = function (/* environment */) {
- return {
- /**
- * Cause a build error if missing translations are detected.
- *
- * See https://ember-intl.github.io/ember-intl/docs/guide/missing-translations#throwing-a-build-error-on-missing-when-required-translations
- *
- * @property errorOnMissingTranslations
- * @type {Boolean}
- * @default "false"
- */
- errorOnMissingTranslations: false,
-
- /**
- * Cause a build error if ICU argument mismatches are detected between translations
- * with the same key across all locales.
- *
- * @property errorOnNamedArgumentMismatch
- * @type {Boolean}
- * @default "false"
- */
- errorOnNamedArgumentMismatch: false,
-
- /**
- * Merges the fallback locale's translations into all other locales as a
- * build-time fallback strategy.
- *
- * This will **not** prevent missing translation warnings or errors from occurring.
- * It's meant as safety net when warnings are enabled.
- * When enabled along with `errorOnMissingTranslations` any fallback attempts will result in an error.
- *
- * @property fallbackLocale
- * @type {String?}
- * @default "null"
- */
- fallbackLocale: null,
-
- /**
- * Path where translations are stored. This is relative to the project root.
- * For example, if your translations are an npm dependency, set this to:
- *`'./node_modules/path/to/translations'`
- *
- * @property inputPath
- * @type {String}
- * @default "'translations'"
- */
- inputPath: 'translations',
-
- /**
- * Prevents the translations from being bundled with the application code.
- * This enables asynchronously loading the translations for the active locale
- * by fetching them from the asset folder of the build.
- *
- * See: https://ember-intl.github.io/ember-intl/docs/guide/asynchronously-loading-translations
- *
- * @property publicOnly
- * @type {Boolean}
- * @default "false"
- */
- publicOnly: false,
-
- /**
- * A function that is called whenever any translation key, from any locale, is missing at build time.
- *
- * See https://ember-intl.github.io/ember-intl/docs/guide/missing-translations#requiring-translations
- *
- * @property requiresTranslation
- * @type {Function}
- * @default "function(key,locale) { return true }"
- */
- requiresTranslation(/* key, locale */) {
- return true;
- },
-
- /**
- * Removes empty translations from the build output.
- *
- * @property stripEmptyTranslations
- * @type {Boolean}
- * @default "false"
- */
- stripEmptyTranslations: false,
-
- /**
- * Add the subdirectories of the translations as a namespace for all keys.
- *
- * @property wrapTranslationsWithNamespace
- * @type {Boolean}
- * @default "false"
- */
- wrapTranslationsWithNamespace: true,
- };
-};
diff --git a/doc-app/config/environment.js b/doc-app/config/environment.js
index e9163331..88e928e3 100644
--- a/doc-app/config/environment.js
+++ b/doc-app/config/environment.js
@@ -1,4 +1,4 @@
-
+'use strict';
module.exports = function (environment) {
const ENV = {
@@ -41,8 +41,6 @@ module.exports = function (environment) {
}
if (environment === 'production') {
- // Allow ember-cli-addon-docs to update the rootURL in compiled assets
- ENV.rootURL = '/ember-common-ui/';
// here you can enable a production-specific feature
}
diff --git a/doc-app/config/targets.js b/doc-app/config/targets.js
index 612c8f73..1e48e059 100644
--- a/doc-app/config/targets.js
+++ b/doc-app/config/targets.js
@@ -1,4 +1,4 @@
-
+'use strict';
const browsers = [
'last 1 Chrome versions',
diff --git a/doc-app/ember-cli-build.cjs b/doc-app/ember-cli-build.cjs
new file mode 100644
index 00000000..081a853d
--- /dev/null
+++ b/doc-app/ember-cli-build.cjs
@@ -0,0 +1,34 @@
+'use strict';
+
+const EmberApp = require('ember-cli/lib/broccoli/ember-app');
+const { compatBuild } = require('@embroider/compat');
+
+module.exports = async function (defaults) {
+ const { buildOnce } = await import('@embroider/vite');
+ const { setConfig } = await import('@warp-drive/core/build-config');
+
+ let app = new EmberApp(defaults, {
+ emberData: {
+ deprecations: {
+ // New projects can safely leave this deprecation disabled.
+ // If upgrading, to opt-into the deprecated behavior, set this to true and then follow:
+ // https://deprecations.emberjs.com/id/ember-data-deprecate-store-extends-ember-object
+ // before upgrading to Ember Data 6.0
+ DEPRECATE_STORE_EXTENDS_EMBER_OBJECT: false,
+ },
+ },
+ // Add options here
+ });
+
+ setConfig(app, __dirname, {
+ compatWith: '4.12',
+ WarpDrive: {
+ activeLogging: {
+ LOG_REQUESTS: true,
+ },
+ },
+ deprecations: {},
+ });
+
+ return compatBuild(app, buildOnce);
+};
diff --git a/doc-app/ember-cli-build.js b/doc-app/ember-cli-build.js
deleted file mode 100644
index 231f63fc..00000000
--- a/doc-app/ember-cli-build.js
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-const EmberApp = require('ember-cli/lib/broccoli/ember-app');
-const sideWatch = require('@embroider/broccoli-side-watch');
-
-module.exports = function (defaults) {
- const app = new EmberApp(defaults, {
- trees: {
- app: sideWatch('app', {
- watching: [
- '@triptyk/ember-input',
- '@triptyk/ember-ui',
- '@triptyk/ember-input-validation',
- ],
- }),
- },
- 'ember-cli-babel': { enableTypeScriptTransform: true },
- 'ember-cli-addon-docs': {
- documentingAddonAt: '../packages/ember-input',
- },
- postcssOptions: {
- compile: {
- enabled: true,
- cacheInclude: [/.*\.(css|hbs|html|ts|gts|gjs)$/, /config\.js/],
- includePaths: ['app', 'tests'],
- plugins: [
- {
- module: require('postcss-import'),
- options: {
- path: ['node_modules'],
- },
- },
- require('tailwindcss')('tailwind.config.js'), // If you have a Tailwind config file.
- ],
- },
- },
- // Add options here
- });
-
- const { Webpack } = require('@embroider/webpack');
- return require('@embroider/compat').compatBuild(app, Webpack, {
- staticAddonTestSupportTrees: true,
- // https://github.com/ember-cli/ember-fetch/issues/622#issuecomment-860399885,
- packagerOptions: {
- webpackConfig: {
- module: {
- rules: [
- {
- test: /\.(gif|svg|jpg|png)$/,
- loader: 'file-loader',
- },
- ],
- },
- },
- },
- staticAddonTrees: false,
- staticHelpers: true,
- staticModifiers: true,
- staticComponents: true,
- staticEmberSource: true,
- skipBabel: [
- {
- package: 'qunit',
- },
- ],
- });
-};
diff --git a/doc-app/ember-intl.config.mjs b/doc-app/ember-intl.config.mjs
new file mode 100644
index 00000000..33fd7483
--- /dev/null
+++ b/doc-app/ember-intl.config.mjs
@@ -0,0 +1,8 @@
+export default {
+ addonPaths: [],
+ buildOptions: {
+ fallbackLocale: 'en-us',
+ inputPath: 'translations',
+ wrapTranslationsWithNamespace: true,
+ },
+};
diff --git a/doc-app/eslint.config.mjs b/doc-app/eslint.config.mjs
new file mode 100644
index 00000000..aa4734bc
--- /dev/null
+++ b/doc-app/eslint.config.mjs
@@ -0,0 +1,127 @@
+/**
+ * Debugging:
+ * https://eslint.org/docs/latest/use/configure/debug
+ * ----------------------------------------------------
+ *
+ * Print a file's calculated configuration
+ *
+ * npx eslint --print-config path/to/file.js
+ *
+ * Inspecting the config
+ *
+ * npx eslint --inspect-config
+ *
+ */
+import globals from 'globals';
+import js from '@eslint/js';
+
+import ts from 'typescript-eslint';
+
+import ember from 'eslint-plugin-ember/recommended';
+
+import eslintConfigPrettier from 'eslint-config-prettier';
+import qunit from 'eslint-plugin-qunit';
+import n from 'eslint-plugin-n';
+
+const parserOptions = {
+ esm: {
+ js: {
+ ecmaFeatures: { modules: true },
+ ecmaVersion: 'latest',
+ },
+ ts: {
+ projectService: true,
+ tsconfigRootDir: import.meta.dirname,
+ },
+ },
+};
+
+export default ts.config(
+ js.configs.recommended,
+ ember.configs.base,
+ ember.configs.gjs,
+ ember.configs.gts,
+ eslintConfigPrettier,
+ /**
+ * Ignores must be in their own object
+ * https://eslint.org/docs/latest/use/configure/ignore
+ */
+ {
+ ignores: ['dist/', 'node_modules/', 'coverage/', '!**/.*'],
+ },
+ /**
+ * https://eslint.org/docs/latest/use/configure/configuration-files#configuring-linter-options
+ */
+ {
+ linterOptions: {
+ reportUnusedDisableDirectives: 'error',
+ },
+ },
+ {
+ files: ['**/*.{js,gjs}'],
+ languageOptions: {
+ parserOptions: parserOptions.esm.js,
+ globals: {
+ ...globals.browser,
+ },
+ },
+ },
+ {
+ files: ['**/*.{ts,gts}'],
+ languageOptions: {
+ parser: ember.parser,
+ parserOptions: parserOptions.esm.ts,
+ },
+ extends: [...ts.configs.recommendedTypeChecked, ember.configs.gts],
+ },
+ {
+ files: ['tests/**/*-test.{js,gjs,ts,gts}'],
+ plugins: {
+ qunit,
+ },
+ },
+ /**
+ * CJS node files
+ */
+ {
+ files: [
+ '**/*.cjs',
+ 'config/**/*.js',
+ 'testem.js',
+ 'testem*.js',
+ '.prettierrc.js',
+ '.stylelintrc.js',
+ '.template-lintrc.js',
+ 'ember-cli-build.js',
+ ],
+ plugins: {
+ n,
+ },
+
+ languageOptions: {
+ sourceType: 'script',
+ ecmaVersion: 'latest',
+ globals: {
+ ...globals.node,
+ },
+ },
+ },
+ /**
+ * ESM node files
+ */
+ {
+ files: ['**/*.mjs'],
+ plugins: {
+ n,
+ },
+
+ languageOptions: {
+ sourceType: 'module',
+ ecmaVersion: 'latest',
+ parserOptions: parserOptions.esm.js,
+ globals: {
+ ...globals.node,
+ },
+ },
+ },
+);
diff --git a/doc-app/app/index.html b/doc-app/index.html
similarity index 52%
rename from doc-app/app/index.html
rename to doc-app/index.html
index 153dc9b7..366c9e0e 100644
--- a/doc-app/app/index.html
+++ b/doc-app/index.html
@@ -8,16 +8,20 @@
{{content-for "head"}}
-
-
+
{{content-for "head-footer"}}
{{content-for "body"}}
-
-
+
+
{{content-for "body-footer"}}
diff --git a/doc-app/package.json b/doc-app/package.json
index ef52aefe..ad5e785d 100644
--- a/doc-app/package.json
+++ b/doc-app/package.json
@@ -1,6 +1,6 @@
{
"name": "doc-app",
- "version": "3.0.1",
+ "version": "0.0.0",
"private": true,
"description": "Small description for doc-app goes here",
"repository": "",
@@ -11,146 +11,123 @@
"test": "tests"
},
"scripts": {
- "_syncPnpm": "pnpm sync-dependencies-meta-injected",
- "build": "ember build --environment=production",
- "lint": "concurrently \"npm:lint:*(!fix)\" --names \"lint:\"",
- "lint:css": "stylelint \"**/*.css\"",
- "lint:css:fix": "concurrently \"npm:lint:css -- --fix\"",
- "lint:fix": "concurrently \"npm:lint:*:fix\" --names \"fix:\"",
+ "build": "vite build",
+ "format": "prettier . --cache --write",
+ "lint": "concurrently \"pnpm:lint:*(!fix)\" --names \"lint:\" --prefixColors auto",
+ "lint:fix": "concurrently \"pnpm:lint:*:fix\" --names \"fix:\" --prefixColors auto && pnpm format",
+ "lint:format": "prettier . --cache --check",
"lint:hbs": "ember-template-lint .",
"lint:hbs:fix": "ember-template-lint . --fix",
"lint:js": "eslint . --cache",
- "lint:glint": "glint",
- "lint:glint:fix": "eslint . --fix",
"lint:js:fix": "eslint . --fix",
- "lint:types": "tsc --noEmit",
- "start": "concurrently 'ember serve' 'pnpm _syncPnpm --watch' --names 'tests serve,tests sync deps'",
- "test": "concurrently \"npm:lint\" \"npm:test:*\" --names \"lint,test:\"",
- "test:ember": "ember test"
+ "_syncPnpm": "pnpm sync-dependencies-meta-injected",
+ "lint:types": "ember-tsc",
+ "start": "concurrently \"pnpm turbo build:watch --filter '@triptyk/ember*'\" \"vite dev\"",
+ "test": "vite build --mode development && ember test --path dist"
+ },
+ "exports": {
+ "./tests/*": "./tests/*",
+ "./*": "./app/*"
},
- "dependenciesMeta": {},
"devDependencies": {
- "@babel/core": "^7.25.2",
+ "@babel/core": "catalog:",
+ "@babel/eslint-parser": "catalog:",
+ "@babel/plugin-transform-runtime": "~7.28.5",
+ "@babel/plugin-transform-typescript": "catalog:",
+ "@babel/runtime": "catalog:",
+ "@ember-intl/vite": "^0.5.0",
+ "@ember/app-tsconfig": "catalog:",
"@ember/optional-features": "catalog:",
- "@ember/string": "^4.0.0",
+ "@ember/string": "catalog:",
"@ember/test-helpers": "catalog:",
- "@embroider/broccoli-side-watch": "^1.0.1",
+ "@ember/test-waiters": "catalog:",
"@embroider/compat": "catalog:",
+ "@embroider/config-meta-loader": "^1.0.0",
"@embroider/core": "catalog:",
- "@embroider/webpack": "catalog:",
- "@eonasdan/tempus-dominus": "^6.9.11",
+ "@embroider/legacy-inspector-support": "^0.1.3",
+ "@embroider/macros": "~1.19.6",
+ "@embroider/router": "~3.0.6",
+ "@embroider/vite": "~1.5.0",
+ "@eslint/js": "catalog:",
"@glimmer/component": "catalog:",
- "@glimmer/tracking": "catalog:",
- "@glint/core": "catalog:",
- "@glint/environment-ember-loose": "catalog:",
- "@glint/environment-ember-template-imports": "^1.5.0",
+ "@glint/ember-tsc": "catalog:",
"@glint/template": "catalog:",
+ "@rollup/plugin-babel": "catalog:",
+ "@tailwindcss/vite": "^4.1.18",
"@triptyk/ember-input": "workspace:*",
"@triptyk/ember-input-validation": "workspace:*",
"@triptyk/ember-ui": "workspace:*",
- "@tsconfig/ember": "catalog:",
- "@types/ember": "catalog:",
- "@types/ember-data": "^4.4.16",
- "@types/ember-data__adapter": "catalog:",
- "@types/ember-data__model": "catalog:",
- "@types/ember-data__serializer": "catalog:",
- "@types/ember-data__store": "^4.0.7",
- "@types/ember__application": "catalog:",
- "@types/ember__array": "catalog:",
- "@types/ember__component": "catalog:",
- "@types/ember__controller": "catalog:",
- "@types/ember__debug": "catalog:",
- "@types/ember__destroyable": "catalog:",
- "@types/ember__engine": "catalog:",
- "@types/ember__error": "catalog:",
- "@types/ember__helper": "catalog:",
- "@types/ember__modifier": "catalog:",
- "@types/ember__object": "catalog:",
- "@types/ember__owner": "catalog:",
- "@types/ember__polyfills": "catalog:",
- "@types/ember__routing": "catalog:",
- "@types/ember__runloop": "catalog:",
- "@types/ember__service": "catalog:",
- "@types/ember__string": "catalog:",
- "@types/ember__template": "catalog:",
- "@types/ember__test": "catalog:",
- "@types/ember__utils": "catalog:",
+ "@triptyk/ember-utils": "workspace:*",
"@types/qunit": "catalog:",
"@types/rsvp": "catalog:",
- "@typescript-eslint/eslint-plugin": "catalog:",
- "@typescript-eslint/parser": "catalog:",
- "autoprefixer": "^10.4.20",
- "broccoli-asset-rev": "catalog:",
+ "@vitest/browser": "^4.0.18",
+ "@vitest/browser-webdriverio": "^4.0.18",
+ "@warp-drive/core": "catalog:",
+ "@warp-drive/core-types": "~5.8.1",
+ "@warp-drive/ember": "~5.8.1",
+ "@warp-drive/json-api": "~5.8.1",
+ "@warp-drive/legacy": "~5.8.1",
+ "@warp-drive/schema-record": "^5.8.1",
+ "@warp-drive/utilities": "~5.8.1",
+ "babel-plugin-ember-template-compilation": "catalog:",
"concurrently": "catalog:",
- "daisyui": "^4.12.14",
- "ember-a11y-testing": "^7.0.2",
- "ember-auto-import": "~2.10.0",
+ "daisyui": "~5.5.14",
+ "decorator-transforms": "catalog:",
+ "ember-a11y-testing": "^7.1.3",
+ "ember-auto-import": "^2.12.0",
"ember-cli": "catalog:",
- "ember-cli-addon-docs": "catalog:",
- "ember-cli-addon-docs-yuidoc": "catalog:",
- "ember-cli-app-version": "catalog:",
"ember-cli-babel": "catalog:",
- "ember-cli-clean-css": "catalog:",
- "ember-cli-dependency-checker": "catalog:",
- "ember-cli-deploy": "catalog:",
- "ember-cli-deploy-build": "catalog:",
- "ember-cli-deploy-git": "catalog:",
- "ember-cli-deploy-git-ci": "catalog:",
- "ember-cli-htmlbars": "catalog:",
- "ember-cli-inject-live-reload": "catalog:",
- "ember-cli-page-object": "^2.3.1",
- "ember-cli-postcss": "^8.2.0",
- "ember-concurrency": "4.0.2",
- "ember-data": "catalog:",
- "ember-fetch": "catalog:",
- "ember-immer-changeset": "^1.0.2",
- "ember-intl": "^7.0.7",
+ "ember-cli-deprecation-workflow": "^4.0.0",
+ "ember-cli-page-object": "^2.3.2",
+ "ember-concurrency": "catalog:",
+ "ember-immer-changeset": "catalog:",
+ "ember-intl": "catalog:",
"ember-load-initializers": "catalog:",
- "ember-modifier": "^4.2.0",
+ "ember-modifier": "catalog:",
"ember-page-title": "catalog:",
- "ember-power-select": "^8.4.0",
+ "ember-power-select": "catalog:",
"ember-qunit": "catalog:",
"ember-resolver": "catalog:",
- "ember-source": "~5.12.0",
- "ember-template-imports": "~4.2.0",
- "ember-template-lint": "^6.0.0",
+ "ember-source": "catalog:",
+ "ember-template-lint": "^7.9.3",
+ "ember-vitest": "^0.3.3",
"ember-welcome-page": "catalog:",
- "eslint": "^8.57.1",
+ "eslint": "catalog:",
"eslint-config-prettier": "catalog:",
- "eslint-plugin-ember": "^12.2.1",
+ "eslint-plugin-ember": "catalog:",
"eslint-plugin-n": "catalog:",
- "eslint-plugin-prettier": "catalog:",
"eslint-plugin-qunit": "catalog:",
- "file-loader": "^6.2.0",
- "loader.js": "catalog:",
- "msw": "^1.3.3",
+ "globals": "catalog:",
+ "msw": "~2.12.7",
"pnpm-sync-dependencies-meta-injected": "catalog:",
- "postcss": "^8.4.49",
- "postcss-import": "^16.1.0",
- "postcss-loader": "^8.1.1",
"prettier": "catalog:",
+ "prettier-plugin-ember-template-tag": "catalog:",
"qunit": "catalog:",
"qunit-dom": "catalog:",
- "rsvp": "catalog:",
+ "shiki": "^3.22.0",
"stylelint": "catalog:",
"stylelint-config-standard": "catalog:",
- "stylelint-prettier": "catalog:",
- "tailwindcss": "^3.4.14",
- "tracked-built-ins": "^3.3.0",
- "typescript": "^5.6.2",
- "webpack": "^5.95.0",
- "yup": "^1.4.0"
+ "tailwindcss": "^4.1.18",
+ "testem": "^3.16.0",
+ "typescript": "catalog:",
+ "typescript-eslint": "catalog:",
+ "vite": "catalog:",
+ "vitest": "^4.0.18",
+ "webdriverio": "^9.23.2",
+ "zod": "catalog:"
},
"engines": {
- "node": ">= 18"
+ "node": ">= 20"
},
"ember": {
"edition": "octane"
},
"msw": {
- "workerDirectory": "public"
+ "workerDirectory": [
+ "public"
+ ]
},
- "volta": {
- "node": "20.20.0"
+ "dependencies": {
+ "ember-showdown": "2.0.0-pre.1"
}
}
diff --git a/doc-app/postcss.config.js b/doc-app/postcss.config.js
deleted file mode 100644
index 12a703d9..00000000
--- a/doc-app/postcss.config.js
+++ /dev/null
@@ -1,6 +0,0 @@
-module.exports = {
- plugins: {
- tailwindcss: {},
- autoprefixer: {},
- },
-};
diff --git a/doc-app/public/assets/default.jpg b/doc-app/public/assets/default.jpg
deleted file mode 100644
index 2fa42bd0..00000000
Binary files a/doc-app/public/assets/default.jpg and /dev/null differ
diff --git a/doc-app/public/assets/edit.svg b/doc-app/public/assets/edit.svg
deleted file mode 100644
index 2c100be3..00000000
--- a/doc-app/public/assets/edit.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
diff --git a/doc-app/public/assets/icons/arrow-down.svg b/doc-app/public/assets/icons/arrow-down.svg
deleted file mode 100644
index 54fe39f9..00000000
--- a/doc-app/public/assets/icons/arrow-down.svg
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/doc-app/public/assets/icons/check-solid.svg b/doc-app/public/assets/icons/check-solid.svg
deleted file mode 100644
index e94b0baa..00000000
--- a/doc-app/public/assets/icons/check-solid.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/doc-app/public/assets/icons/kebab.svg b/doc-app/public/assets/icons/kebab.svg
deleted file mode 100644
index 7e509dee..00000000
--- a/doc-app/public/assets/icons/kebab.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
diff --git a/doc-app/public/assets/icons/plus.svg b/doc-app/public/assets/icons/plus.svg
deleted file mode 100644
index 0ba260af..00000000
--- a/doc-app/public/assets/icons/plus.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/doc-app/public/assets/icons/trash.svg b/doc-app/public/assets/icons/trash.svg
deleted file mode 100644
index ccac2089..00000000
--- a/doc-app/public/assets/icons/trash.svg
+++ /dev/null
@@ -1,11 +0,0 @@
-
- Bin
- A line styled icon from Orion Icon Library.
-
-
-
\ No newline at end of file
diff --git a/doc-app/public/assets/img/ember_common_ui_logo.png b/doc-app/public/assets/img/ember_common_ui_logo.png
new file mode 100644
index 00000000..79fd849c
Binary files /dev/null and b/doc-app/public/assets/img/ember_common_ui_logo.png differ
diff --git a/doc-app/public/assets/img/ember_common_ui_logo.svg b/doc-app/public/assets/img/ember_common_ui_logo.svg
new file mode 100644
index 00000000..84180555
--- /dev/null
+++ b/doc-app/public/assets/img/ember_common_ui_logo.svg
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/doc-app/app/templates/docs/ember-input-validation/checkbox.md b/doc-app/public/docs/ember-input-validation/checkbox.md
similarity index 64%
rename from doc-app/app/templates/docs/ember-input-validation/checkbox.md
rename to doc-app/public/docs/ember-input-validation/checkbox.md
index 2f3b2295..caa843bb 100644
--- a/doc-app/app/templates/docs/ember-input-validation/checkbox.md
+++ b/doc-app/public/docs/ember-input-validation/checkbox.md
@@ -2,27 +2,27 @@
Ember input validation/checkbox content
-
-
-
-
-
-
- {{#each T.errors as |error|}}
-
- {{error.message}}
-
- {{/each}}
-
-
-
-
+
+
+
+
+
+
+{{#each T.errors as |error|}}
+
+{{error.message}}
+
+{{/each}}
+
+
+
+
### Args
@@ -52,4 +52,4 @@ the function receive the value and the event as args.
**[data-has-error="false"]** : CSS element when there is no error.
-**[data-has-error="true"]** : CSS element when an error is caught. when it's true error was displayed on the aside element.
\ No newline at end of file
+**[data-has-error="true"]** : CSS element when an error is caught. when it's true error was displayed on the aside element.
diff --git a/doc-app/app/templates/docs/ember-input-validation/datepicker.md b/doc-app/public/docs/ember-input-validation/datepicker.md
similarity index 79%
rename from doc-app/app/templates/docs/ember-input-validation/datepicker.md
rename to doc-app/public/docs/ember-input-validation/datepicker.md
index 77083e70..59be4620 100644
--- a/doc-app/app/templates/docs/ember-input-validation/datepicker.md
+++ b/doc-app/public/docs/ember-input-validation/datepicker.md
@@ -5,26 +5,27 @@ A date picker component with built-in validation support using changesets. This
## Basic Usage
-
-
-
-
-
- {{#each D.errors as |error|}}
-
- {{error.message}}
-
- {{/each}}
-
-
-
-
+
+
+
+
+
+
+{{#each D.errors as |error|}}
+
+{{error.message}}
+
+{{/each}}
+
+
+
+
## Arguments
@@ -84,6 +85,7 @@ See the [TpkDatepicker documentation](../ember-input/datepicker) for all availab
## Validation
The component automatically:
+
- Updates the changeset when dates are selected
- Displays validation state via the `data-has-error` attribute
- Handles single dates, date ranges, and multiple dates based on `@mode`
diff --git a/doc-app/app/templates/docs/ember-input-validation/file.md b/doc-app/public/docs/ember-input-validation/file.md
similarity index 63%
rename from doc-app/app/templates/docs/ember-input-validation/file.md
rename to doc-app/public/docs/ember-input-validation/file.md
index 7da15050..6501b621 100644
--- a/doc-app/app/templates/docs/ember-input-validation/file.md
+++ b/doc-app/public/docs/ember-input-validation/file.md
@@ -5,51 +5,53 @@ A file input component with built-in validation support using changesets. This c
## Basic Usage
-
-
-
-
-
- {{#each F.errors as |error|}}
-
- {{error.message}}
-
- {{/each}}
-
-
-
-
+
+
+
+
+
+
+{{#each F.errors as |error|}}
+
+{{error.message}}
+
+{{/each}}
+
+
+
+
## Multiple File Upload
-
-
-
-
-
- {{#each F.errors as |error|}}
-
- {{error.message}}
-
- {{/each}}
-
-
-
-
+
+
+
+
+
+
+{{#each F.errors as |error|}}
+
+{{error.message}}
+
+{{/each}}
+
+
+
+
## Arguments
@@ -91,6 +93,7 @@ A file input component with built-in validation support using changesets. This c
## Validation
The component automatically:
+
- Updates the changeset when files are selected
- Stores a single `File` object when `@multiple` is false
- Stores an array of `File` objects when `@multiple` is true
diff --git a/doc-app/app/templates/docs/ember-input-validation/input.md b/doc-app/public/docs/ember-input-validation/input.md
similarity index 64%
rename from doc-app/app/templates/docs/ember-input-validation/input.md
rename to doc-app/public/docs/ember-input-validation/input.md
index de470746..68aa76dc 100644
--- a/doc-app/app/templates/docs/ember-input-validation/input.md
+++ b/doc-app/public/docs/ember-input-validation/input.md
@@ -3,24 +3,25 @@
Ember input validation/input content
-
-
-
-
-
- {{#each I.errors as |error|}}
-
- {{error.message}}
-
- {{/each}}
-
-
-
-
+
+
+
+
+
+
+{{#each I.errors as |error|}}
+
+{{error.message}}
+
+{{/each}}
+
+
+
+
### Args
@@ -46,7 +47,7 @@ the function receive the value and the event as args.
**.tpk-input** : CSS class for styling the input of the checkbox (label and input box).
-**.tpk-input input** : CSS class for styling the targeted input.
+**.tpk-input input** : CSS class for styling the targeted input.
**.tpk-label** : CSS class for styling the label of the input.
diff --git a/doc-app/app/templates/docs/ember-input-validation/installation.md b/doc-app/public/docs/ember-input-validation/installation.md
similarity index 86%
rename from doc-app/app/templates/docs/ember-input-validation/installation.md
rename to doc-app/public/docs/ember-input-validation/installation.md
index a2f56d65..049cb5d1 100644
--- a/doc-app/app/templates/docs/ember-input-validation/installation.md
+++ b/doc-app/public/docs/ember-input-validation/installation.md
@@ -20,7 +20,6 @@ import '@glint/environment-ember-loose';
import type EmberInputValidationRegistry from '@triptyk/ember-input-validation/template-registry';
declare module '@glint/environment-ember-loose/registry' {
- export default interface Registry
- extends EmberInputValidationRegistry {}
+ export default interface Registry extends EmberInputValidationRegistry {}
}
```
diff --git a/doc-app/app/templates/docs/ember-input-validation/prefabs/bic.md b/doc-app/public/docs/ember-input-validation/prefabs/bic.md
similarity index 51%
rename from doc-app/app/templates/docs/ember-input-validation/prefabs/bic.md
rename to doc-app/public/docs/ember-input-validation/prefabs/bic.md
index c28d778e..b9630db8 100644
--- a/doc-app/app/templates/docs/ember-input-validation/prefabs/bic.md
+++ b/doc-app/public/docs/ember-input-validation/prefabs/bic.md
@@ -3,33 +3,32 @@
This is an input with a built-in mask for BIC.
The mask should be compatible for any BIC and text can only be in capital letters.
-
-
-
-
-
-
-
+
+
+
+
+
+
## Usage
@@ -47,5 +46,5 @@ The `TpkValidationBic` component is used for a simple input.
- `@placeholder`: The placeholder text for the input field.
- `@mandatory`: Whether the textarea field is mandatory.
- `@disabled`: Whether the input field is disabled.
-- `@onChange`: The action to be called when the selection changes.
+- `@onChange`: The action to be called when the selection changes.
- `@changeEvent`: The event to trigger the onChange action.
diff --git a/doc-app/public/docs/ember-input-validation/prefabs/checkbox.md b/doc-app/public/docs/ember-input-validation/prefabs/checkbox.md
new file mode 100644
index 00000000..d799cf77
--- /dev/null
+++ b/doc-app/public/docs/ember-input-validation/prefabs/checkbox.md
@@ -0,0 +1,43 @@
+# Checkbox
+
+This component provides a checkbox.
+
+
+
+
+
+
+
+
+
+
+
+## Mandatory properties
+
+- `@validationField`: The field name in the changeset for validation.
+- `@changeset`: The changeset object for form validation.
+
+## Optional properties
+
+- `@label`: The label for the input field.
+- `@disabled`: Whether the input field is disabled.
+- `@mandatory`: Whether the textarea field is mandatory.
+- `@onChange`: The action to be called when the selection changes.
+- `@changeEvent`: The event to trigger the onChange action.
diff --git a/doc-app/app/templates/docs/ember-input-validation/prefabs/currency.md b/doc-app/public/docs/ember-input-validation/prefabs/currency.md
similarity index 50%
rename from doc-app/app/templates/docs/ember-input-validation/prefabs/currency.md
rename to doc-app/public/docs/ember-input-validation/prefabs/currency.md
index abba3777..e1bfde2f 100644
--- a/doc-app/app/templates/docs/ember-input-validation/prefabs/currency.md
+++ b/doc-app/public/docs/ember-input-validation/prefabs/currency.md
@@ -1,36 +1,37 @@
# Currency
-The currency validation prefab is used to validate currency input fields.
+The currency validation prefab is used to validate currency input fields.
It is provided with a mask to format the input field as currency.
The only supported format is euro at the moment.
-
-
-
-
+
+
+
-
-
+
+
+
## Mandatory properties
@@ -43,5 +44,5 @@ The only supported format is euro at the moment.
- `@label`: The label for the input field.
- `@disabled`: Whether the input field is disabled.
- `@mandatory`: Whether the textarea field is mandatory.
-- `@onChange`: The action to be called when the selection changes.
-- `@changeEvent`: The event to trigger the onChange action.
\ No newline at end of file
+- `@onChange`: The action to be called when the selection changes.
+- `@changeEvent`: The event to trigger the onChange action.
diff --git a/doc-app/app/templates/docs/ember-input-validation/prefabs/datepicker-range.md b/doc-app/public/docs/ember-input-validation/prefabs/datepicker-range.md
similarity index 73%
rename from doc-app/app/templates/docs/ember-input-validation/prefabs/datepicker-range.md
rename to doc-app/public/docs/ember-input-validation/prefabs/datepicker-range.md
index 1ccb9425..27e317c8 100644
--- a/doc-app/app/templates/docs/ember-input-validation/prefabs/datepicker-range.md
+++ b/doc-app/public/docs/ember-input-validation/prefabs/datepicker-range.md
@@ -3,25 +3,25 @@
This component provides a datepicker with range selection and built-in validation.
-
-
-
-
-
-
+
+
+
+
+
+
## Usage
diff --git a/doc-app/app/templates/docs/ember-input-validation/prefabs/datepicker.md b/doc-app/public/docs/ember-input-validation/prefabs/datepicker.md
similarity index 78%
rename from doc-app/app/templates/docs/ember-input-validation/prefabs/datepicker.md
rename to doc-app/public/docs/ember-input-validation/prefabs/datepicker.md
index 49f0c923..8f994d56 100644
--- a/doc-app/app/templates/docs/ember-input-validation/prefabs/datepicker.md
+++ b/doc-app/public/docs/ember-input-validation/prefabs/datepicker.md
@@ -3,25 +3,25 @@
This component provides a datepicker and built-in validation.
-
-
-
-
-
-
+
+
+
+
+
+
## Usage
diff --git a/doc-app/public/docs/ember-input-validation/prefabs/email.md b/doc-app/public/docs/ember-input-validation/prefabs/email.md
new file mode 100644
index 00000000..f035d055
--- /dev/null
+++ b/doc-app/public/docs/ember-input-validation/prefabs/email.md
@@ -0,0 +1,40 @@
+# Input Email
+
+This is an input with type Email
+
+
+
+
+
+
+
+
+
+
+## Mandatory properties
+
+- `@validationField`: The field name in the changeset for validation.
+- `@changeset`: The changeset object for form validation.
+
+## Optional properties
+
+- `@label`: The label for the input field.
+- `@disabled`: Whether the input field is disabled.
+- `@mandatory`: Whether the textarea field is mandatory.
+- `@onChange`: The action to be called when the selection changes.
+- `@changeEvent`: The event to trigger the onChange action.
diff --git a/doc-app/public/docs/ember-input-validation/prefabs/file-list.md b/doc-app/public/docs/ember-input-validation/prefabs/file-list.md
new file mode 100644
index 00000000..39957ca1
--- /dev/null
+++ b/doc-app/public/docs/ember-input-validation/prefabs/file-list.md
@@ -0,0 +1,43 @@
+# Input File
+
+This is an input with a dropzone that allows to upload multiple files. You can also find a list of uploaded files and dowload/delete theme.
+
+
+
+
+
+
+
+
+
+
+## Mandatory properties
+
+- `@validationField`: The field name in the changeset for validation.
+- `@changeset`: The changeset object for form validation.
+
+## Optional properties
+
+- `@label`: The label for the input field.
+- `@disabled`: Whether the input field is disabled.
+- `@mandatory`: Whether the input file multiple field is mandatory.
+- `@onChange`: The action to be called when the selection changes.
+- `@disableDownload`: Whether the download button is disabled.
+- `@placeholder`: The placeholder for the dropzone area.
diff --git a/doc-app/public/docs/ember-input-validation/prefabs/file.md b/doc-app/public/docs/ember-input-validation/prefabs/file.md
new file mode 100644
index 00000000..a119cea4
--- /dev/null
+++ b/doc-app/public/docs/ember-input-validation/prefabs/file.md
@@ -0,0 +1,41 @@
+# Input File
+
+This is an input with type File
+
+
+
+
+
+
+
+
+
+
+## Mandatory properties
+
+- `@validationField`: The field name in the changeset for validation.
+- `@changeset`: The changeset object for form validation.
+
+## Optional properties
+
+- `@label`: The label for the input field.
+- `@disabled`: Whether the input field is disabled.
+- `@mandatory`: Whether the textarea field is mandatory.
+- `@onChange`: The action to be called when the selection changes.
+- `@changeEvent`: The event to trigger the onChange action.
diff --git a/doc-app/app/templates/docs/ember-input-validation/prefabs/iban.md b/doc-app/public/docs/ember-input-validation/prefabs/iban.md
similarity index 55%
rename from doc-app/app/templates/docs/ember-input-validation/prefabs/iban.md
rename to doc-app/public/docs/ember-input-validation/prefabs/iban.md
index cad421d2..07e7f630 100644
--- a/doc-app/app/templates/docs/ember-input-validation/prefabs/iban.md
+++ b/doc-app/public/docs/ember-input-validation/prefabs/iban.md
@@ -7,28 +7,28 @@ The value is formated so that there 4 character then a space up to the end of th
If the country is not supported, the input value will be blocked after 2 uppercase letters
-
-
-
-
-
-
+
+
+
+
+
+
## Mandatory properties
@@ -41,5 +41,5 @@ If the country is not supported, the input value will be blocked after 2 upperca
- `@label`: The label for the input field.
- `@disabled`: Whether the input field is disabled.
- `@mandatory`: Whether the textarea field is mandatory.
-- `@onChange`: The action to be called when the selection changes.
+- `@onChange`: The action to be called when the selection changes.
- `@changeEvent`: The event to trigger the onChange action.
diff --git a/doc-app/app/templates/docs/ember-input-validation/prefabs/input.md b/doc-app/public/docs/ember-input-validation/prefabs/input.md
similarity index 60%
rename from doc-app/app/templates/docs/ember-input-validation/prefabs/input.md
rename to doc-app/public/docs/ember-input-validation/prefabs/input.md
index f31b83fc..173c1ce2 100644
--- a/doc-app/app/templates/docs/ember-input-validation/prefabs/input.md
+++ b/doc-app/public/docs/ember-input-validation/prefabs/input.md
@@ -3,28 +3,28 @@
This component provides an input.
-
-
-
-
-
-
-
+
+
+
+
+
+
+
## Usage
@@ -46,6 +46,5 @@ The `TpkValidationInput` component is used for a simple input. If you want use a
- `@maskOptions`: The options to apply to the mask.
- `@unmaskValue`: Whether to unmask the value before setting it in the changeset.
- `@disabled`: Whether the input field is disabled.
-- `@onChange`: The action to be called when the selection changes.
+- `@onChange`: The action to be called when the selection changes.
- `@changeEvent`: The event to trigger the onChange action.
-
diff --git a/doc-app/public/docs/ember-input-validation/prefabs/integer.md b/doc-app/public/docs/ember-input-validation/prefabs/integer.md
new file mode 100644
index 00000000..5921ca82
--- /dev/null
+++ b/doc-app/public/docs/ember-input-validation/prefabs/integer.md
@@ -0,0 +1,44 @@
+# Integer
+
+The integer validation input prefab is used when an integer input is required.
+
+It prevents decimal numbers by disallowing the comma and period.
+
+The integer validation input can be restricted to a minimum of 0 or allow negative numbers.
+
+
+
+
+
+
+
+
+
diff --git a/doc-app/app/templates/docs/ember-input-validation/prefabs/mobile.md b/doc-app/public/docs/ember-input-validation/prefabs/mobile.md
similarity index 61%
rename from doc-app/app/templates/docs/ember-input-validation/prefabs/mobile.md
rename to doc-app/public/docs/ember-input-validation/prefabs/mobile.md
index d2bb48f2..1b44e0d1 100644
--- a/doc-app/app/templates/docs/ember-input-validation/prefabs/mobile.md
+++ b/doc-app/public/docs/ember-input-validation/prefabs/mobile.md
@@ -6,24 +6,24 @@ You've 5 prefixes : **Luxembourg, Deutshland, Netherlands, Belgium and France.**
-
-
-
+
+
+
diff --git a/doc-app/public/docs/ember-input-validation/prefabs/national-number.md b/doc-app/public/docs/ember-input-validation/prefabs/national-number.md
new file mode 100644
index 00000000..5db93ed0
--- /dev/null
+++ b/doc-app/public/docs/ember-input-validation/prefabs/national-number.md
@@ -0,0 +1,30 @@
+# Input national number
+
+This is an input with a built-in mask for a belgian national number.
+It makes so that the national number is written in a pretty format similar
+to the one on your belgian ID.
+
+
+
+
+
+
+
+
+
diff --git a/doc-app/public/docs/ember-input-validation/prefabs/number.md b/doc-app/public/docs/ember-input-validation/prefabs/number.md
new file mode 100644
index 00000000..f888dc67
--- /dev/null
+++ b/doc-app/public/docs/ember-input-validation/prefabs/number.md
@@ -0,0 +1,51 @@
+# Number
+
+The number validation input can be blocked at a minimum of 0 or be a negative number
+
+
+
+
+
+
+
+
+
+
diff --git a/doc-app/public/docs/ember-input-validation/prefabs/password.md b/doc-app/public/docs/ember-input-validation/prefabs/password.md
new file mode 100644
index 00000000..f2a91e94
--- /dev/null
+++ b/doc-app/public/docs/ember-input-validation/prefabs/password.md
@@ -0,0 +1,34 @@
+# Input password
+
+This is a password input field.
+
+
+
+
+
+
+
+
+
diff --git a/doc-app/app/templates/docs/ember-input-validation/prefabs/radio-group.md b/doc-app/public/docs/ember-input-validation/prefabs/radio-group.md
similarity index 76%
rename from doc-app/app/templates/docs/ember-input-validation/prefabs/radio-group.md
rename to doc-app/public/docs/ember-input-validation/prefabs/radio-group.md
index 146703cd..f8dbf1f1 100644
--- a/doc-app/app/templates/docs/ember-input-validation/prefabs/radio-group.md
+++ b/doc-app/public/docs/ember-input-validation/prefabs/radio-group.md
@@ -3,13 +3,13 @@
This component provides a group of radio buttons.
-
-
+
@@ -19,11 +19,11 @@ This component provides a group of radio buttons.
-
@@ -32,13 +32,14 @@ This component provides a group of radio buttons.
selected : {{changeset-get this.changesetWithErrors 'radio'}}
-
-
+
+
+
## Usage
-The `TpkValidationRadioGroup` component is used for a group of radio button.
+The `TpkValidationRadioGroup` component is used for a group of radio button.
## Mandatory properties
@@ -52,11 +53,11 @@ The `TpkValidationRadioGroup` component is used for a group of radio button.
- `@mandatory`: Whether the textarea field is mandatory.
- `@disabled`: Whether the input field is disabled.
- `@classless`: Whether to apply default classes to the component.
-- `@onChange`: The action to be called when the selection changes.
+- `@onChange`: The action to be called when the selection changes.
## Css classes
-- `.tpk-validation-radio-container` : CSS class which includes the label and the group
+- `.tpk-validation-radio-container` : CSS class which includes the label and the group
- `.tpk-validation-radio-group-label` : CSS class for the label of the group
- `.tpk-validation-radio-group-group` : CSS class for the group of radio buttons
- `.tpk-radio` : CSS class for styling the input of the radio button (label and input box).
diff --git a/doc-app/app/templates/docs/ember-input-validation/prefabs/radio.md b/doc-app/public/docs/ember-input-validation/prefabs/radio.md
similarity index 59%
rename from doc-app/app/templates/docs/ember-input-validation/prefabs/radio.md
rename to doc-app/public/docs/ember-input-validation/prefabs/radio.md
index 87ca8692..d40c188f 100644
--- a/doc-app/app/templates/docs/ember-input-validation/prefabs/radio.md
+++ b/doc-app/public/docs/ember-input-validation/prefabs/radio.md
@@ -3,20 +3,22 @@
This component provides a radio button.
-
-
-
-
-
+
+
+
+
+
+
selected : {{changeset-get this.changeset 'radio'}}
-
-
+
+
+
## Usage
-The `TpkValidationRadio` component is used for a simple radio button.
+The `TpkValidationRadio` component is used for a simple radio button.
## Mandatory properties
@@ -30,7 +32,7 @@ The `TpkValidationRadio` component is used for a simple radio button.
- `@mandatory`: Whether the textarea field is mandatory.
- `@disabled`: Whether the input field is disabled.
- `@classless`: Whether to apply default classes to the component.
-- `@onChange`: The action to be called when the selection changes.
+- `@onChange`: The action to be called when the selection changes.
## Css classes
diff --git a/doc-app/app/templates/docs/ember-input-validation/prefabs/select-create.md b/doc-app/public/docs/ember-input-validation/prefabs/select-create.md
similarity index 52%
rename from doc-app/app/templates/docs/ember-input-validation/prefabs/select-create.md
rename to doc-app/public/docs/ember-input-validation/prefabs/select-create.md
index 052f233b..bdab944d 100644
--- a/doc-app/app/templates/docs/ember-input-validation/prefabs/select-create.md
+++ b/doc-app/public/docs/ember-input-validation/prefabs/select-create.md
@@ -4,42 +4,48 @@ This component provides a powerfull select with ability to create a new value an
It uses also toString() in order to display the options and the selected element.
-In example:
+In example:
```ts
- options = [
- { label: 'Option 1', value: 'option-1', toString() { return `${this.label}`; } }
- ];
+options = [
+ {
+ label: 'Option 1',
+ value: 'option-1',
+ toString() {
+ return `${this.label}`;
+ },
+ },
+];
```
-
-
-
-
-
-
+
+
+
+
+
+
## Mandatory properties
@@ -58,7 +64,7 @@ In example:
- `@initiallyOpened`: Whether the select dropdown is initially opened.
- `@allowClear`: Whether to show a button to clear the selection.
- `@mandatory`: Whether the textarea field is mandatory.
-- `@onChange`: The action to be called when the selection changes.
+- `@onChange`: The action to be called when the selection changes.
- `@labelComponent`: The custom component to use for the label.
- `@selectedItemComponent`: The custom component to use for the selected item.
- `@placeholderComponent`: The custom component to use for the placeholder
@@ -75,37 +81,38 @@ In example:
### Select create multiple
-
-
-
-
+
+
+
+
### Select create with specific label and hide create option when value already exist
+
To test it, write Romain in input
-
-
-
-
+
+
+
+
diff --git a/doc-app/public/docs/ember-input-validation/prefabs/select-search.md b/doc-app/public/docs/ember-input-validation/prefabs/select-search.md
new file mode 100644
index 00000000..d9eac9eb
--- /dev/null
+++ b/doc-app/public/docs/ember-input-validation/prefabs/select-search.md
@@ -0,0 +1,117 @@
+# Select Search
+
+This component provides a powerfull select with search and has built-in validation. It uses [ember-power-select](https://ember-power-select.com/).
+
+It uses also toString() in order to display the options and the selected element.
+
+In example:
+
+```ts
+options = [
+ {
+ label: 'Option 1',
+ value: 'option-1',
+ toString() {
+ return `${this.label}`;
+ },
+ },
+];
+```
+
+
+
+
+
+
+
+
+
+
+## Mandatory properties
+
+- `@validationField`: The field name in the changeset for validation.
+- `@changeset`: The changeset object for form validation.
+- `@options`: The options to display in the select dropdown.
+- `@onSearch`: The action to be called when user's typing in the input.
+
+## Optional properties
+
+- `@label`: The label for the input field.
+- `@placeholder`: The placeholder text for the input field.
+- `@disabled`: Whether the input field is disabled.
+- `@multiple`: Whether multiple selections are allowed.
+- `@initiallyOpened`: Whether the select dropdown is initially opened.
+- `@mandatory`: Whether the textarea field is mandatory.
+- `@allowClear`: Whether to show a button to clear the selection.
+- `@onChange`: The action to be called when the selection changes.
+- `@labelComponent`: The custom component to use for the label.
+- `@selectedItemComponent`: The custom component to use for the selected item.
+- `@placeholderComponent`: The custom component to use for the placeholder
+- `@searchPlaceholder`: The placeholder text for the search input.
+- `@searchMessage`: Message shown in options list when no search has been entered and there are no options.
+- `@loadingMessage`: Message shown in options list when loading options.
+- `@noMatchesMessage`: Message shown in options list when no matches are found.
+
+## Examples
+
+### Select Search multiple with allowClear
+
+
+
+
+
+
+
+
+### Select Search with all label translate and initially opened
+
+
+
+
+
+
+
diff --git a/doc-app/public/docs/ember-input-validation/prefabs/select.md b/doc-app/public/docs/ember-input-validation/prefabs/select.md
new file mode 100644
index 00000000..2706dc57
--- /dev/null
+++ b/doc-app/public/docs/ember-input-validation/prefabs/select.md
@@ -0,0 +1,143 @@
+# Select
+
+This component provides a powerfull select with multitude features and has built-in validation. It uses [ember-power-select](https://ember-power-select.com/).
+
+It uses also toString() in order to display the options and the selected element.
+
+In example:
+
+```ts
+options = [
+ {
+ label: 'Option 1',
+ value: 'option-1',
+ toString() {
+ return `${this.label}`;
+ },
+ },
+];
+```
+
+
+
+
+
+
+
+
+
+
+## Mandatory properties
+
+- `@validationField`: The field name in the changeset for validation.
+- `@changeset`: The changeset object for form validation.
+- `@options`: The options to display in the select dropdown.
+
+## Optional properties
+
+- `@label`: The label for the input field.
+- `@placeholder`: The placeholder text for the input field.
+- `@disabled`: Whether the input field is disabled.
+- `@multiple`: Whether multiple selections are allowed.
+- `@mandatory`: Whether the textarea field is mandatory.
+- `@initiallyOpened`: Whether the select dropdown is initially opened.
+- `@allowClear`: Whether to show a button to clear the selection.
+- `@onChange`: The action to be called when the selection changes.
+- `@labelComponent`: The custom component to use for the label.
+- `@selectedItemComponent`: The custom component to use for the selected item.
+- `@placeholderComponent`: The custom component to use for the placeholder
+
+## Examples
+
+### Select multiple
+
+
+
+
+
+
+
+
+### Select with specific component for label
+
+
+
+
+
+
+
+
+
+
+
+
+### Select with allowClear
+
+
+
+
+
+
+
+
+### Select initially opened
+
+
+
+
+
+
+
diff --git a/doc-app/public/docs/ember-input-validation/prefabs/textarea.md b/doc-app/public/docs/ember-input-validation/prefabs/textarea.md
new file mode 100644
index 00000000..537a1199
--- /dev/null
+++ b/doc-app/public/docs/ember-input-validation/prefabs/textarea.md
@@ -0,0 +1,58 @@
+# Textarea
+
+This component provides an textarea.
+
+
+
+
+
+
+
+
+
+
+## Mandatory properties
+
+- `@validationField`: The field name in the changeset for validation.
+- `@changeset`: The changeset object for form validation.
+
+## Optional properties
+
+- `@label`: The label for the textarea field.
+- `@placeholder`: The placeholder text for the textarea field.
+- `@mandatory`: Whether the textarea field is mandatory.
+- `@disabled`: Whether the input field is disabled.
+- `@onChange`: The action to be called when the selection changes.
+- `@changeEvent`: The event to trigger the onChange action.
+- `@maxLength`: The maximum length of the textarea field.
+
+## Examples
+
+### Textarea with maxLength
+
+
+
+
+
+
+
diff --git a/doc-app/app/templates/docs/ember-input-validation/prefabs/timepicker.md b/doc-app/public/docs/ember-input-validation/prefabs/timepicker.md
similarity index 66%
rename from doc-app/app/templates/docs/ember-input-validation/prefabs/timepicker.md
rename to doc-app/public/docs/ember-input-validation/prefabs/timepicker.md
index 1bd6f80b..c59fcffc 100644
--- a/doc-app/app/templates/docs/ember-input-validation/prefabs/timepicker.md
+++ b/doc-app/public/docs/ember-input-validation/prefabs/timepicker.md
@@ -3,26 +3,26 @@
This component provides a timepicker with built-in validation.
-
-
-
-
-
-
+
+
+
+
+
+
## Usage
@@ -46,4 +46,3 @@ The `TpkValidationTimepicker` component is designed for easy integration into yo
- `@placeholder`: The placeholder text for the input field.
- `@clearButton`: Whether to show a button to clear the input field.
- `@locale`: The locale to be used for date formatting.
-
diff --git a/doc-app/app/templates/docs/ember-input-validation/prefabs/vat.md b/doc-app/public/docs/ember-input-validation/prefabs/vat.md
similarity index 57%
rename from doc-app/app/templates/docs/ember-input-validation/prefabs/vat.md
rename to doc-app/public/docs/ember-input-validation/prefabs/vat.md
index 91d8a68f..aecb6eef 100644
--- a/doc-app/app/templates/docs/ember-input-validation/prefabs/vat.md
+++ b/doc-app/public/docs/ember-input-validation/prefabs/vat.md
@@ -6,28 +6,28 @@ Natively, it does supports belgium, french, luxembourgish, dutch and german VAT.
If the country is not supported, the input value will be blocked after 2 uppercase letters
-
-
-
-
-
-
+
+
+
+
+
+
## Usage
@@ -45,6 +45,5 @@ The `TpkValidationVat` component is used for a vat input.
- `@placeholder`: The placeholder text for the input field.
- `@mandatory`: Whether the textarea field is mandatory.
- `@disabled`: Whether the input field is disabled.
-- `@onChange`: The action to be called when the selection changes.
+- `@onChange`: The action to be called when the selection changes.
- `@changeEvent`: The event to trigger the onChange action.
-
diff --git a/doc-app/app/templates/docs/ember-input-validation/radio-group.md b/doc-app/public/docs/ember-input-validation/radio-group.md
similarity index 61%
rename from doc-app/app/templates/docs/ember-input-validation/radio-group.md
rename to doc-app/public/docs/ember-input-validation/radio-group.md
index 6778500a..49cb5870 100644
--- a/doc-app/app/templates/docs/ember-input-validation/radio-group.md
+++ b/doc-app/public/docs/ember-input-validation/radio-group.md
@@ -2,24 +2,23 @@
Ember input validation/radio group content
-
-
-
-
-
-
-
-
-
-
-
-
-
- Result: {{changeset-get this.changeset 'radio'}}
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+Result: {{changeset-get this.changeset 'radio'}}
+
+
+
### Args
@@ -40,10 +39,9 @@ Ember input validation/radio group content
**I.Input**: The component representing the radio.
-
### CSS
-**.tpk-validation-radio-container** : CSS class which includes the label and the group
+**.tpk-validation-radio-container** : CSS class which includes the label and the group
**.tpk-validation-radio-group-label** : CSS class for the label of the group
@@ -51,4 +49,4 @@ Ember input validation/radio group content
**.tpk-radio** : CSS class for styling the input of the radio button (label and input box).
-**.tpk-radio-label** : CSS class for styling the label of the input.
\ No newline at end of file
+**.tpk-radio-label** : CSS class for styling the label of the input.
diff --git a/doc-app/app/templates/docs/ember-input-validation/radio.md b/doc-app/public/docs/ember-input-validation/radio.md
similarity index 84%
rename from doc-app/app/templates/docs/ember-input-validation/radio.md
rename to doc-app/public/docs/ember-input-validation/radio.md
index 750761d6..560d4b65 100644
--- a/doc-app/app/templates/docs/ember-input-validation/radio.md
+++ b/doc-app/public/docs/ember-input-validation/radio.md
@@ -3,7 +3,8 @@
Ember validation radio
-
+
+
-
-
+
-
-
+
+
Result: {{changeset-get this.changeset 'radio'}}
-
-
+
+
### Args
@@ -55,10 +57,8 @@ Ember validation radio
**@classless** : The argument allows overriding the CSS class of the input.
-
### CSS
**.tpk-radio** : CSS class for styling the input of the radio button (label and input box).
**.tpk-radio-label** : CSS class for styling the label of the input.
-
diff --git a/doc-app/app/templates/docs/ember-input-validation/select.md b/doc-app/public/docs/ember-input-validation/select.md
similarity index 63%
rename from doc-app/app/templates/docs/ember-input-validation/select.md
rename to doc-app/public/docs/ember-input-validation/select.md
index b671c1b9..5645cd45 100644
--- a/doc-app/app/templates/docs/ember-input-validation/select.md
+++ b/doc-app/public/docs/ember-input-validation/select.md
@@ -5,60 +5,62 @@ A select dropdown component with built-in validation support using changesets. T
## Basic Usage
-
-
-
-
- {{if S.hasSelection S.selected "Select..."}}
-
-
-
- {{opt.option}}
-
-
-
- {{#each S.errors as |error|}}
-
- {{error.message}}
-
- {{/each}}
-
-
-
-
+
+
+
+
+{{if S.hasSelection S.selected "Select..."}}
+
+
+
+
+{{opt.option}}
+
+
+
+{{#each S.errors as |error|}}
+
+{{error.message}}
+
+{{/each}}
+
+
+
+
## Multiple Selection
-
-
-
-
- {{if S.hasSelection S.selected "Select..."}}
-
-
-
- {{#if opt.isSelected}}✓{{/if}}
- {{opt.option}}
-
-
-
-
-
+
+
+
+
+{{if S.hasSelection S.selected "Select..."}}
+
+
+
+
+{{#if opt.isSelected}}✓{{/if}}
+{{opt.option}}
+
+
+
+
+
## Arguments
@@ -96,6 +98,7 @@ A select dropdown component with built-in validation support using changesets. T
**S.Button**: Button that displays the current selection and toggles the dropdown.
**S.Options**: Options list container. Yields an option component that provides:
+
- **opt.option**: The option value
- **opt.isSelected**: Boolean indicating if this option is selected
diff --git a/doc-app/app/templates/docs/ember-input-validation/textarea.md b/doc-app/public/docs/ember-input-validation/textarea.md
similarity index 76%
rename from doc-app/app/templates/docs/ember-input-validation/textarea.md
rename to doc-app/public/docs/ember-input-validation/textarea.md
index a75a02e5..73fa30e1 100644
--- a/doc-app/app/templates/docs/ember-input-validation/textarea.md
+++ b/doc-app/public/docs/ember-input-validation/textarea.md
@@ -5,30 +5,31 @@ A textarea component with built-in validation support using changesets. This com
## Basic Usage
-
-
-
-
-
- {{T.charCount}} / {{T.maxLength}}
-
-
-
-
- {{#each T.errors as |error|}}
-
- {{error.message}}
-
- {{/each}}
-
-
-
-
+
+
+
+
+
+
+{{T.charCount}} / {{T.maxLength}}
+
+
+
+
+{{#each T.errors as |error|}}
+
+{{error.message}}
+
+{{/each}}
+
+
+
+
## Arguments
@@ -78,6 +79,7 @@ A textarea component with built-in validation support using changesets. This com
## Validation
The component automatically:
+
- Updates the changeset as the user types (or on change, depending on `@changeEvent`)
- Displays validation state via the `data-has-error` attribute
- Enforces `@maxLength` if specified
diff --git a/doc-app/public/docs/ember-input/button.md b/doc-app/public/docs/ember-input/button.md
new file mode 100644
index 00000000..5d97c27b
--- /dev/null
+++ b/doc-app/public/docs/ember-input/button.md
@@ -0,0 +1,26 @@
+# Ember input/button
+
+A button component that performs an onClick task.
+
+By default, prevents spam click by waiting the current task to finish before accepting a new one.
+
+
+
+
+Spam me @allowSpam={{true}}
+
+
+Spam me @allowSpam={{false}}
+
+
+
+Counter : {{this.counter}}
+
+
+
+
diff --git a/doc-app/public/docs/ember-input/checkbox.md b/doc-app/public/docs/ember-input/checkbox.md
new file mode 100644
index 00000000..92952518
--- /dev/null
+++ b/doc-app/public/docs/ember-input/checkbox.md
@@ -0,0 +1,21 @@
+# Ember input/checkbox
+
+A composable checkbox input element.
+
+
+
+
+
+
+
+
+
+Checked: {{this.checked}}
+
+
+
+
diff --git a/doc-app/app/templates/docs/ember-input/datepicker.md b/doc-app/public/docs/ember-input/datepicker.md
similarity index 54%
rename from doc-app/app/templates/docs/ember-input/datepicker.md
rename to doc-app/public/docs/ember-input/datepicker.md
index 317de76d..2f7d47fe 100644
--- a/doc-app/app/templates/docs/ember-input/datepicker.md
+++ b/doc-app/public/docs/ember-input/datepicker.md
@@ -3,36 +3,36 @@
An Ember component for date selection with extensive customization options. This component provides a user interface for selecting dates and applying input masks for formatting.
-
-
-
-
-
-
-
+
+
+
+
+
+
+
## Mandatory Arguments
- **value**: The initial date or dates to display in the date picker. Can be a single `Date`, a `string`, or `undefined`.
- ```typescript
- @tracked selectedDate: Date | string | undefined = new Date();
- ```
+ ```typescript
+ @tracked selectedDate: Date | string | undefined = new Date();
+ ```
- **onChange**: A function called when the date is changed. Receives the new values as argument.
- ```typescript
- @action
- onChange(dates: Date[]): void {
- this.selectedDate = dates[0];
- }
- ```
+ ```typescript
+ @action
+ onChange(dates: Date[]): void {
+ this.selectedDate = dates[0];
+ }
+ ```
## Optional Arguments
@@ -40,9 +40,9 @@ An Ember component for date selection with extensive customization options. This
- **mask**: An input mask for formatting the date input when writing, using the IMask library.
- ```typescript
- @tracked dateMask: string = 'd-m/Y';
- ```
+ ```typescript
+ @tracked dateMask: string = 'd-m/Y';
+ ```
- **placeholder**: Placeholder text displayed when the date field is empty.
@@ -52,16 +52,16 @@ An Ember component for date selection with extensive customization options. This
- **stepping**: The number of minutes to step up/down in the time picker. Defaults to 5.
-- **mode**:
-
- __Multiple__
+- **mode**:
+
+ **Multiple**
Allow the selection of multiple dates. Returns values after two dates are picked at least
- __Range__
+ **Range**
Enable date range selection. Returns values after two dates are picked
-
+
- **multipleDatesSeparator**: The separator to use when multiple dates are selected.
- **range**: Enable date range selection. Defaults to `false`. Returns values after two dates are picked
@@ -106,106 +106,105 @@ An Ember component for date selection with extensive customization options. This
- **viewMode**: The initial view mode of the date picker. Can be 'clock', 'calendar', 'months', 'years', or 'decades'.
-
## Limitation
-Currently, the datepicker cannot have a __default value__ for modes [`range`] and [`multiple`]. For more details, see [this issue](https://github.com/Eonasdan/tempus-dominus/issues/2830)
+Currently, the datepicker cannot have a **default value** for modes [`range`] and [`multiple`]. For more details, see [this issue](https://github.com/Eonasdan/tempus-dominus/issues/2830)
## Examples
### Date picker range
-
-
-
-
-
-
-
+
+
+
+
+
+
+
### Time picker with mask
-
-
-
-
-
-
-
+
+
+
+
+
+
+
### Date picker with minDate, maxDate and a default value
-
-
-
-
-
-
-
+
+
+
+
+
+
+
### Date picker shows month selector first
-
-
-
-
-
-
-
+
+
+
+
+
+
+
### Show picker after select a date
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/doc-app/public/docs/ember-input/file.md b/doc-app/public/docs/ember-input/file.md
new file mode 100644
index 00000000..15919b23
--- /dev/null
+++ b/doc-app/public/docs/ember-input/file.md
@@ -0,0 +1,49 @@
+# Ember input/file
+
+The **TpkFileInputComponent** is designed to handle file input in a web application. It encapsulates an HTML file field (`
+
+
+
+
+
+
+
+
+
+**Multiple input/file**
+
+
+
+
+
+
+
+
+
+
+## Arguments description
+
+- **accept?: string**
+ - This argument is optional and expects a string. It specifies the file types the user can select. For example, "image/\*" will accept all image types.
+- **disabled?: boolean**
+ - This argument is optional and is a boolean. If it is supplied and evaluates to true, the file field will be disabled. Otherwise, it will be enabled.
+- **multiple?: boolean**
+ - This argument is optional and is a boolean. If provided and evaluated to true, the file field will allow the user to select multiple files at once. Otherwise, only one file can be selected.
+- **changeEvent: 'input' | 'change'**
+ - This argument is mandatory and must be one of two string values: 'input' or 'change'. It specifies the type of change event associated with the file input field. This can be useful to customize when the onChange callback function is triggered.
+- **onChange: (event: Event) => void**
+ - This argument is mandatory and waits for a callback function that takes an argument of type Event. This callback function will be called when the specified change event ('input' or 'change') occurs on the file field. It can be used to perform actions in response to file changes.
diff --git a/doc-app/public/docs/ember-input/input.md b/doc-app/public/docs/ember-input/input.md
new file mode 100644
index 00000000..9aaba0a8
--- /dev/null
+++ b/doc-app/public/docs/ember-input/input.md
@@ -0,0 +1,22 @@
+# Ember input/input
+
+A composable html input element.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Value: {{this.value}}
+
+
+
+
+
diff --git a/doc-app/app/templates/docs/ember-input/installation.md b/doc-app/public/docs/ember-input/installation.md
similarity index 85%
rename from doc-app/app/templates/docs/ember-input/installation.md
rename to doc-app/public/docs/ember-input/installation.md
index 0c870c9b..67d6e7bb 100644
--- a/doc-app/app/templates/docs/ember-input/installation.md
+++ b/doc-app/public/docs/ember-input/installation.md
@@ -10,7 +10,6 @@ Install the peer dependencies if needed:
ember install ember-flatpickr
```
-
## Importing types
Add the Glint template-registry to your global.d.ts file:
@@ -20,7 +19,6 @@ import '@glint/environment-ember-loose';
import type EmberInputRegistry from '@triptyk/ember-input/template-registry';
declare module '@glint/environment-ember-loose/registry' {
- export default interface Registry
- extends EmberInputRegistry {}
+ export default interface Registry extends EmberInputRegistry {}
}
```
diff --git a/doc-app/public/docs/ember-input/prefabs/button.md b/doc-app/public/docs/ember-input/prefabs/button.md
new file mode 100644
index 00000000..8b225dd7
--- /dev/null
+++ b/doc-app/public/docs/ember-input/prefabs/button.md
@@ -0,0 +1,28 @@
+# Button
+
+A button. This is a simple wrapper around the `input` element with `type="button"`.
+
+
+
+
+
+count = {{this.counter}}
+
+
+
+
+## Mandatory properties
+
+- `@label`: The label for the button field.
+- `@onClick`: The action to be called when the button clicked.
+
+## Optional properties
+
+- `@disabled`: Whether the button field is disabled.
+
+## Important
+
+- `class`: To create a custom class you must do it in a CSS file to override the button class
diff --git a/doc-app/public/docs/ember-input/prefabs/toggle.md b/doc-app/public/docs/ember-input/prefabs/toggle.md
new file mode 100644
index 00000000..7a251901
--- /dev/null
+++ b/doc-app/public/docs/ember-input/prefabs/toggle.md
@@ -0,0 +1,11 @@
+# Toggle
+
+A toggle switch. This is a simple wrapper around the `input` element with `type="checkbox"`.
+
+
+
+
+
+
+
+
diff --git a/doc-app/app/templates/docs/ember-input/radio.md b/doc-app/public/docs/ember-input/radio.md
similarity index 95%
rename from doc-app/app/templates/docs/ember-input/radio.md
rename to doc-app/public/docs/ember-input/radio.md
index 6da6bb46..f4a6a13b 100644
--- a/doc-app/app/templates/docs/ember-input/radio.md
+++ b/doc-app/public/docs/ember-input/radio.md
@@ -3,7 +3,8 @@
Ember input/radio content
-
+
+
Choose your gender
**value**: a string type that must be identical among radios in the same group.
- **@onChange**:
> **description**: specifies the method called when the state of the radio is changed.
- > **value**: an hbs type string which should be the name of the method defined in the controller. e.g., ```{{this.setRadio}}```
+ > **value**: an hbs type string which should be the name of the method defined in the controller. e.g., `{{this.setRadio}}`
### This component has 2 mandatory yields:
+
- **Input**: representing the radio type input
- **Label**: representing the label of our radio
diff --git a/doc-app/app/templates/docs/ember-input/select.md b/doc-app/public/docs/ember-input/select.md
similarity index 53%
rename from doc-app/app/templates/docs/ember-input/select.md
rename to doc-app/public/docs/ember-input/select.md
index acbebffa..4aeb5956 100644
--- a/doc-app/app/templates/docs/ember-input/select.md
+++ b/doc-app/public/docs/ember-input/select.md
@@ -3,6 +3,7 @@
An Ember input/select that performs an onChange task which allows it to display selection coming from select options.
## With base arguments
+
The following arguments are declared in the js controller paired with your hbs working file and given to the component by using the **@** (e.g. **@options**)
- **options**: A tracked value corresponding to the array of options of the select. Given value has to be an array of elements.
@@ -10,6 +11,7 @@ The following arguments are declared in the js controller paired with your hbs w
```js
@tracked sauceOptions = ["BBQ", "Ketchup", "Dallas"];
```
+
- **selected**: Allows your selected value to be displayed as the button label. By default if no value is selected, base value is displayed. Here base button value is "...".
```js
@@ -28,25 +30,25 @@ The following arguments are declared in the js controller paired with your hbs w
- **label**: Corresponds to the title of the select.
-
-
-
-
- {{if S.hasSelection S.selected "..."}}
-
-
-
- {{opt.option}}
-
-
-
-
-
+
+
+
+
+{{if S.hasSelection S.selected "..."}}
+
+
+
+{{opt.option}}
+
+
+
+
+
## With optional arguments added
@@ -55,31 +57,28 @@ The following arguments are declared in the js controller paired with your hbs w
Keeping the same process as explained before the values will be displayed as button label using `@selected={{this.valueCar}}`.
-
-
-
-
-
- {{if S.hasSelection S.selected "..."}}
-
-
-
- {{#if opt.selected}}
- ok
- {{/if}}
- {{opt.option}}
-
-
-
-
-
+
+
+
+
+{{if S.hasSelection S.selected "..."}}
+
+
+
+{{#if opt.selected}}
+ok
+{{/if}}
+{{opt.option}}
+
+
+
+
+
-
-
diff --git a/doc-app/app/templates/docs/ember-input/textarea.md b/doc-app/public/docs/ember-input/textarea.md
similarity index 63%
rename from doc-app/app/templates/docs/ember-input/textarea.md
rename to doc-app/public/docs/ember-input/textarea.md
index 799a09ec..dd1c83c4 100644
--- a/doc-app/app/templates/docs/ember-input/textarea.md
+++ b/doc-app/public/docs/ember-input/textarea.md
@@ -3,27 +3,28 @@
A composable textarea input element.
-
-
-
-
-
- {{C.charCount}} / {{C.maxLength}}
-
-
-
-
-
- Content: {{this.value}}
-
-
-
+
+
+
+
+
+
+{{C.charCount}} / {{C.maxLength}}
+
+
+
+
+
+Content: {{this.value}}
+
+
+
### Args
@@ -47,13 +48,12 @@ the function receive the value and the event as args.
**C.charCount**: The current length of the String within the textarea
-**C.maxLength**: The maximum length of the String within the textarea
+**C.maxLength**: The maximum length of the String within the textarea
### CSS
-**.tpk-textarea**: the class added by default to the div wrapping the textarea and the label.
+**.tpk-textarea**: the class added by default to the div wrapping the textarea and the label.
**.tpk-label**: the class added by default to the label.
**.tpk-textarea-input**: the class added by default to the textarea.
-
diff --git a/doc-app/public/docs/ember-ui/actions-menu.md b/doc-app/public/docs/ember-ui/actions-menu.md
new file mode 100644
index 00000000..497d9685
--- /dev/null
+++ b/doc-app/public/docs/ember-ui/actions-menu.md
@@ -0,0 +1,16 @@
+# Actions menu
+
+A component for a tooltip-like actions menu.
+
+
+
+
+
+Edit
+
+
+
+
+
diff --git a/doc-app/app/templates/docs/ember-ui/installation.md b/doc-app/public/docs/ember-ui/installation.md
similarity index 86%
rename from doc-app/app/templates/docs/ember-ui/installation.md
rename to doc-app/public/docs/ember-ui/installation.md
index 79db8aab..eb4a922d 100644
--- a/doc-app/app/templates/docs/ember-ui/installation.md
+++ b/doc-app/public/docs/ember-ui/installation.md
@@ -19,7 +19,6 @@ import '@glint/environment-ember-loose';
import type EmberUIValidationRegistry from '@triptyk/ember-ui/template-registry';
declare module '@glint/environment-ember-loose/registry' {
- export default interface Registry
- extends EmberUIRegistry {}
+ export default interface Registry extends EmberUIRegistry {}
}
```
diff --git a/doc-app/public/docs/ember-ui/modal.md b/doc-app/public/docs/ember-ui/modal.md
new file mode 100644
index 00000000..94205c17
--- /dev/null
+++ b/doc-app/public/docs/ember-ui/modal.md
@@ -0,0 +1,26 @@
+# Modal
+
+A modal component.
+
+
+
+
+Open the modal
+
+
+
+
+
+
+Click outside to close
+Focusable element
+
+
+
+
+
diff --git a/doc-app/public/docs/ember-ui/prefabs/confirm-modal.md b/doc-app/public/docs/ember-ui/prefabs/confirm-modal.md
new file mode 100644
index 00000000..6329997b
--- /dev/null
+++ b/doc-app/public/docs/ember-ui/prefabs/confirm-modal.md
@@ -0,0 +1,32 @@
+# Modal
+
+A modal component.
+
+
+
+
+Open the modal
+
+
+
+
+
+
+
+## Mandatory properties
+
+- `@onClose`: this is a function to close modal.
+- `@onConfirm`: this is a function to close modal.
+- `@cancelText`: this is a string to populate cancel button
+- `@confirmText`: this is a string to populate confirm button
+- `@confirmQuestion`: this is the text of confirmation to user
+- `@isOpen` : boolean to close modal
diff --git a/doc-app/app/templates/docs/ember-ui/prefabs/table-generic.md b/doc-app/public/docs/ember-ui/prefabs/table-generic.md
similarity index 84%
rename from doc-app/app/templates/docs/ember-ui/prefabs/table-generic.md
rename to doc-app/public/docs/ember-ui/prefabs/table-generic.md
index 3b75d86a..191e0eae 100644
--- a/doc-app/app/templates/docs/ember-ui/prefabs/table-generic.md
+++ b/doc-app/public/docs/ember-ui/prefabs/table-generic.md
@@ -6,11 +6,11 @@ It is also possible to pass components to the desired column.
# Basic usage:
-
-
-
-
-
+
+
+
+
+
## Mandatory properties
@@ -18,6 +18,7 @@ It is also possible to pass components to the desired column.
- `@tableParams`: The field name in the changeset for validation.
# Advanced Usage:
+
!!! Ember doc cannotdisplay example with code snippet
```ts
@@ -53,15 +54,12 @@ export class TableRouteComponent extends Component
onUpdate = (selection: unknown, row: UserModel) => {
row.set('email', selection as string);
- console.log(selection);
- console.log(row);
- }
options=this.emailOptions
onUpdate=this.onUpdate
)
- }}
+ }}
/>
@@ -99,6 +97,7 @@ class SelectTableRegister extends Component;
}
```
+
## Optional properties
-- `@columnsComponent:` The component that will be passed to the column of the table.
\ No newline at end of file
+- `@columnsComponent:` The component that will be passed to the column of the table.
diff --git a/doc-app/public/docs/ember-ui/prefabs/tpk-form-component-en.md b/doc-app/public/docs/ember-ui/prefabs/tpk-form-component-en.md
new file mode 100644
index 00000000..44178f32
--- /dev/null
+++ b/doc-app/public/docs/ember-ui/prefabs/tpk-form-component-en.md
@@ -0,0 +1,487 @@
+# TpkForm Component
+
+A comprehensive form component that integrates validation using `ember-immer-changeset` and `zod`. The component provides automatic validation, error handling, and yields pre-configured validation input components.
+
+
+
+
+
+
+
+
+
+Submit
+
+
+
+
+
+## Mandatory properties
+
+- `@changeset`: An instance of [ImmerChangeset](https://triptyk.github.io/ember-immer-changeset/classes/ImmerChangeset.html) containing the form data. This changeset manages the form state and validation errors.
+- `@onSubmit`: A callback function executed when the form is submitted with valid data. Receives two parameters: `(data, changeset)` where data is the validated object and changeset is the ImmerChangeset instance.
+- `@validationSchema`: A Zod schema (ZodObject) that defines the validation rules for the form fields.
+
+## Optional properties
+
+- `@reactive` (Boolean, default: `true`): When enabled, validates individual fields immediately when their values change. Set to `false` to validate only on form submission.
+- `@removeErrorsOnSubmit` (Boolean, default: `true`): Clears all existing validation errors before performing validation on submit.
+- `@autoScrollOnError` (Boolean, default: `true`): Automatically scrolls to the first validation error when submission fails.
+- `@disabled` (Boolean, default: `false`): Disables all form inputs when set to `true`.
+- `@executeOnValid` (Boolean, default: `true`): Automatically executes the changeset (applies draft changes to data) when validation passes.
+
+## Implementation Guide
+
+### 1. Controller/Component Setup
+
+Create a changeset, validation schema, and submit handler:
+
+```typescript
+import Controller from '@ember/controller';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import { object, string, email } from 'zod';
+import { action } from '@ember/object';
+
+export default class MyFormController extends Controller {
+ // Initialize an empty changeset
+ changeset = new ImmerChangeset({
+ firstName: '',
+ lastName: '',
+ email: '',
+ });
+
+ // Define validation rules with Zod
+ validationSchema = object({
+ firstName: string().min(2, 'First name must be at least 2 characters'),
+ lastName: string().min(2, 'Last name must be at least 2 characters'),
+ email: string().email('Must be a valid email address'),
+ });
+
+ @action
+ handleSubmit(validatedData, changeset) {
+ // validatedData contains the validated form data
+ // changeset is the ImmerChangeset instance
+ console.log('Form submitted with:', validatedData);
+ // Perform your API call or data processing here
+ }
+}
+```
+
+### 2. Using the TpkForm Component
+
+The form yields a hash of pre-configured validation components:
+
+```gts
+
+ {{! Use yielded prefab components }}
+
+
+
+
+
+
+ Submit
+
+```
+
+### 3. Available Yielded Components
+
+The `TpkForm` component yields numerous pre-configured components, all automatically bound with the changeset, disabled state, and required fields:
+
+#### Base Components (for custom layouts)
+
+- `F.TpkInput` - Base input component
+- `F.TpkTextarea` - Base textarea component
+- `F.TpkSelect` - Base select component
+- `F.TpkCheckbox` - Base checkbox component
+- `F.TpkRadio` - Base radio component
+- `F.TpkRadioGroup` - Radio group component
+- `F.TpkFile` - Base file input component
+- `F.TpkDatepicker` - Base datepicker component
+
+#### Prefab Components (ready-to-use)
+
+- `F.TpkInputPrefab` - Standard text input
+- `F.TpkTextareaPrefab` - Textarea with validation
+- `F.TpkSelectPrefab` - Select dropdown
+- `F.TpkSelectCreatePrefab` - Select with create option
+- `F.TpkSelectSearchPrefab` - Searchable select
+- `F.TpkCheckboxPrefab` - Checkbox with label
+- `F.TpkRadioPrefab` - Single radio button
+- `F.TpkRadioGroupPrefab` - Radio button group
+- `F.TpkFilePrefab` - File upload input
+
+#### Specialized Input Prefabs
+
+- `F.TpkPasswordPrefab` - Password input with visibility toggle
+- `F.TpkEmailPrefab` - Email input with validation
+- `F.TpkMobilePrefab` - Mobile phone number input
+- `F.TpkIbanPrefab` - IBAN (bank account) input
+- `F.TpkBicPrefab` - BIC/SWIFT code input
+- `F.TpkVatPrefab` - VAT number input
+- `F.TpkNationalNumberPrefab` - National identification number
+- `F.TpkCurrencyPrefab` - Currency/money input
+- `F.TpkIntegerPrefab` - Integer number input
+- `F.TpkNumberPrefab` - Decimal number input
+
+#### Date/Time Prefabs
+
+- `F.TpkDatepickerPrefab` - Single date picker
+- `F.TpkDatepickerRangePrefab` - Date range picker
+- `F.TpkTimepickerPrefab` - Time picker
+
+#### Yielded Helper Values
+
+- `F.changesetGet` - Function to retrieve values from the changeset (shortcut for `changeset.get()`)
+- `F.requiredFields` - Array of field names that are required according to the validation schema
+
+### 4. Using Base Components for Custom Layouts
+
+Base components give you full control over the markup:
+
+```gts
+
+
+
+
+ {{#if I.errors}}
+
+ {{#each I.errors as |error|}}
+
{{error.message}}
+ {{/each}}
+
+ {{/if}}
+
+
+ Submit
+
+```
+
+### 5. Validation Behavior
+
+#### Reactive Validation (Default)
+
+When `@reactive={{true}}` (default), fields are validated as soon as their values change:
+
+```gts
+
+ {{! Field validates on every change }}
+
+
+```
+
+#### Submit-Only Validation
+
+Set `@reactive={{false}}` to validate only when the form is submitted:
+
+```gts
+
+ {{! Field validates only on submit }}
+
+
+```
+
+### 6. Error Handling and Auto-Scrolling
+
+Control error clearing and auto-scroll behavior:
+
+```gts
+
+ {{! Errors cleared before validation, scrolls to first error }}
+
+
+
+```
+
+### 7. Disabled State
+
+Disable the entire form and all its inputs:
+
+```gts
+
+ {{! All inputs will be disabled when isLoading is true }}
+
+
+```
+
+### 8. Working with Required Fields
+
+Access the list of required fields from the validation schema:
+
+```gts
+
+ Required fields: {{F.requiredFields.length}}
+
+
+
+ {{#if (includes F.requiredFields "email")}}
+ Email is required
+ {{/if}}
+
+
+```
+
+### 9. changesetGet Helper
+
+Use the `changesetGet` helper to retrieve values without repeating the `@changeset` argument:
+
+```gts
+
+
+
+
+ Full name: {{F.changesetGet "firstName"}} {{F.changesetGet "lastName"}}
+
+```
+
+### 10. Complex Form Example
+
+```typescript
+// Controller
+import Controller from '@ember/controller';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import { object, string, number, boolean, date } from 'zod';
+import { action } from '@ember/object';
+import { tracked } from '@glimmer/tracking';
+
+export default class ComplexFormController extends Controller {
+ @tracked isSubmitting = false;
+
+ changeset = new ImmerChangeset({
+ firstName: '',
+ lastName: '',
+ email: '',
+ phone: '',
+ birthday: null,
+ country: null,
+ subscribe: false,
+ });
+
+ validationSchema = object({
+ firstName: string().min(2),
+ lastName: string().min(2),
+ email: string().email(),
+ phone: string().optional(),
+ birthday: date(),
+ country: string().min(2),
+ subscribe: boolean(),
+ });
+
+ countryOptions = [
+ { label: 'Belgium', value: 'BE' },
+ { label: 'France', value: 'FR' },
+ { label: 'Netherlands', value: 'NL' },
+ ];
+
+ @action
+ async handleSubmit(validatedData, changeset) {
+ this.isSubmitting = true;
+ try {
+ await this.saveUser(validatedData);
+ alert('User saved successfully!');
+ } catch (error) {
+ console.error('Save failed:', error);
+ } finally {
+ this.isSubmitting = false;
+ }
+ }
+}
+```
+
+```gts
+{{! Template }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{if this.isSubmitting "Saving..." "Save User"}}
+
+
+```
+
+## Customizing Default Components
+
+The default yielded components are the standard validation components (`TpkValidation*`), but you can change these default components by modifying the values in the TpkForm service.
+
+```typescript
+let tpkFormService = this.owner.lookup('service:tpk-form') as TpkFormService;
+
+// Base Components
+tpkFormService.TpkInput = CustomInput;
+tpkFormService.TpkTextarea = CustomTextarea;
+tpkFormService.TpkSelect = CustomSelect;
+tpkFormService.TpkCheckbox = CustomCheckbox;
+tpkFormService.TpkRadio = CustomRadio;
+tpkFormService.TpkRadioGroup = CustomRadioGroup;
+tpkFormService.TpkFile = CustomFile;
+tpkFormService.TpkDatepicker = CustomDatepicker;
+
+// Prefab Components
+tpkFormService.TpkInputPrefab = CustomInputPrefab;
+tpkFormService.TpkTextareaPrefab = CustomTextareaPrefab;
+tpkFormService.TpkSelectPrefab = CustomSelectPrefab;
+tpkFormService.TpkSelectCreatePrefab = CustomSelectCreatePrefab;
+tpkFormService.TpkSelectSearchPrefab = CustomSelectSearchPrefab;
+tpkFormService.TpkCheckboxPrefab = CustomCheckboxPrefab;
+tpkFormService.TpkRadioPrefab = CustomRadioPrefab;
+tpkFormService.TpkRadioGroupPrefab = CustomRadioGroupPrefab;
+tpkFormService.TpkDatepickerPrefab = CustomDatepickerPrefab;
+tpkFormService.TpkDatepickerRangePrefab = CustomDatepickerRangePrefab;
+tpkFormService.TpkTimepickerPrefab = CustomTimepickerPrefab;
+
+// Specialized Input Prefabs
+tpkFormService.TpkPasswordPrefab = CustomPasswordPrefab;
+tpkFormService.TpkEmailPrefab = CustomEmailPrefab;
+tpkFormService.TpkIbanPrefab = CustomIbanPrefab;
+tpkFormService.TpkBicPrefab = CustomBicPrefab;
+tpkFormService.TpkVatPrefab = CustomVatPrefab;
+tpkFormService.TpkNationalNumberPrefab = CustomNationalNumberPrefab;
+tpkFormService.TpkCurrencyPrefab = CustomCurrencyPrefab;
+tpkFormService.TpkIntegerPrefab = CustomIntegerPrefab;
+tpkFormService.TpkNumberPrefab = CustomNumberPrefab;
+tpkFormService.TpkMobilePrefab = CustomMobilePrefab;
+tpkFormService.TpkFilePrefab = CustomFilePrefab;
+```
+
+This customization allows you to replace the default components with your own implementations while maintaining the form's structure and behavior.
+
+## Key Features
+
+1. **Automatic Validation**: Seamlessly integrates with Zod schemas for comprehensive validation rules.
+2. **Error Management**: Automatically displays validation errors and clears them as needed.
+3. **Changeset Integration**: Uses `ember-immer-changeset` for efficient state management and change tracking.
+4. **Rich Component Library**: Provides 30+ pre-configured input components for common use cases.
+5. **Flexible Validation**: Supports both reactive (on-change) and submit-only validation modes.
+6. **Accessibility**: Auto-scrolls to errors and properly manages focus states.
+7. **Type Safety**: Full TypeScript support with generic type parameters for schema inference.
+8. **Customizable**: Can override default components via the TpkForm service.
+
+## Important Notes
+
+- The `@onSubmit` callback is only executed when the form is valid.
+- By default, the changeset is automatically executed (changes applied) before calling `@onSubmit`. Set `@executeOnValid={{false}}` to prevent this.
+- All yielded components are pre-bound with the changeset, disabled state, and required fields list.
+- The validation schema must use Zod (not Yup, which was used in older versions).
+- Field names in the validation schema must match the `@validationField` values used in the form inputs.
+- The component automatically handles calculating required fields based on the Zod schema and updates the list when data changes.
diff --git a/doc-app/public/docs/ember-ui/prefabs/tpk-form-component.md b/doc-app/public/docs/ember-ui/prefabs/tpk-form-component.md
new file mode 100644
index 00000000..2e6d367a
--- /dev/null
+++ b/doc-app/public/docs/ember-ui/prefabs/tpk-form-component.md
@@ -0,0 +1,487 @@
+# TpkForm Component
+
+Un composant de formulaire complet qui intègre la validation avec `ember-immer-changeset` et `zod`. Le composant fournit une validation automatique, gestion des erreurs et yield des composants de validation pré-configurés.
+
+
+
+
+
+
+
+
+
+Soumettre
+
+
+
+
+
+## Propriétés obligatoires
+
+- `@changeset`: Une instance de [ImmerChangeset](https://triptyk.github.io/ember-immer-changeset/classes/ImmerChangeset.html) contenant les données du formulaire. Ce changeset gère l'état du formulaire et les erreurs de validation.
+- `@onSubmit`: Une fonction callback exécutée quand le formulaire est soumis avec des données valides. Reçoit deux paramètres : `(data, changeset)` où data est l'objet validé et changeset est l'instance ImmerChangeset.
+- `@validationSchema`: Un schéma Zod (ZodObject) qui définit les règles de validation pour les champs du formulaire.
+
+## Propriétés optionnelles
+
+- `@reactive` (Boolean, défaut: `true`): Quand activé, valide les champs individuellement dès que leurs valeurs changent. Mettez à `false` pour valider uniquement lors de la soumission.
+- `@removeErrorsOnSubmit` (Boolean, défaut: `true`): Efface toutes les erreurs de validation existantes avant d'effectuer la validation lors de la soumission.
+- `@autoScrollOnError` (Boolean, défaut: `true`): Fait défiler automatiquement vers la première erreur de validation quand la soumission échoue.
+- `@disabled` (Boolean, défaut: `false`): Désactive tous les inputs du formulaire quand défini à `true`.
+- `@executeOnValid` (Boolean, défaut: `true`): Exécute automatiquement le changeset (applique les modifications draft aux données) quand la validation réussit.
+
+## Guide d'implémentation
+
+### 1. Configuration du Controller/Component
+
+Créez un changeset, un schéma de validation et un gestionnaire de soumission :
+
+```typescript
+import Controller from '@ember/controller';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import { object, string, email } from 'zod';
+import { action } from '@ember/object';
+
+export default class MyFormController extends Controller {
+ // Initialiser un changeset vide
+ changeset = new ImmerChangeset({
+ firstName: '',
+ lastName: '',
+ email: '',
+ });
+
+ // Définir les règles de validation avec Zod
+ validationSchema = object({
+ firstName: string().min(2, 'Le prénom doit contenir au moins 2 caractères'),
+ lastName: string().min(2, 'Le nom doit contenir au moins 2 caractères'),
+ email: string().email('Doit être une adresse email valide'),
+ });
+
+ @action
+ handleSubmit(validatedData, changeset) {
+ // validatedData contient les données validées du formulaire
+ // changeset est l'instance ImmerChangeset
+ console.log('Formulaire soumis avec:', validatedData);
+ // Effectuez votre appel API ou traitement de données ici
+ }
+}
+```
+
+### 2. Utilisation du composant TpkForm
+
+Le formulaire yield un hash de composants de validation pré-configurés :
+
+```gts
+
+ {{! Utiliser les composants prefab yieldés }}
+
+
+
+
+
+
+ Soumettre
+
+```
+
+### 3. Composants Yieldés disponibles
+
+Le composant `TpkForm` yield de nombreux composants pré-configurés, tous automatiquement liés avec le changeset, l'état disabled et les champs requis :
+
+#### Composants de base (pour layouts personnalisés)
+
+- `F.TpkInput` - Composant input de base
+- `F.TpkTextarea` - Composant textarea de base
+- `F.TpkSelect` - Composant select de base
+- `F.TpkCheckbox` - Composant checkbox de base
+- `F.TpkRadio` - Composant radio de base
+- `F.TpkRadioGroup` - Composant groupe de radios
+- `F.TpkFile` - Composant input fichier de base
+- `F.TpkDatepicker` - Composant datepicker de base
+
+#### Composants Prefab (prêts à l'emploi)
+
+- `F.TpkInputPrefab` - Input texte standard
+- `F.TpkTextareaPrefab` - Textarea avec validation
+- `F.TpkSelectPrefab` - Menu déroulant select
+- `F.TpkSelectCreatePrefab` - Select avec option de création
+- `F.TpkSelectSearchPrefab` - Select avec recherche
+- `F.TpkCheckboxPrefab` - Checkbox avec label
+- `F.TpkRadioPrefab` - Bouton radio unique
+- `F.TpkRadioGroupPrefab` - Groupe de boutons radio
+- `F.TpkFilePrefab` - Input upload de fichier
+
+#### Inputs Prefab Spécialisés
+
+- `F.TpkPasswordPrefab` - Input mot de passe avec toggle de visibilité
+- `F.TpkEmailPrefab` - Input email avec validation
+- `F.TpkMobilePrefab` - Input numéro de téléphone mobile
+- `F.TpkIbanPrefab` - Input IBAN (compte bancaire)
+- `F.TpkBicPrefab` - Input code BIC/SWIFT
+- `F.TpkVatPrefab` - Input numéro de TVA
+- `F.TpkNationalNumberPrefab` - Input numéro d'identification nationale
+- `F.TpkCurrencyPrefab` - Input montant/devise
+- `F.TpkIntegerPrefab` - Input nombre entier
+- `F.TpkNumberPrefab` - Input nombre décimal
+
+#### Prefabs Date/Heure
+
+- `F.TpkDatepickerPrefab` - Sélecteur de date unique
+- `F.TpkDatepickerRangePrefab` - Sélecteur de plage de dates
+- `F.TpkTimepickerPrefab` - Sélecteur d'heure
+
+#### Valeurs Helper Yieldées
+
+- `F.changesetGet` - Fonction pour récupérer des valeurs du changeset (raccourci pour `changeset.get()`)
+- `F.requiredFields` - Tableau des noms de champs qui sont requis selon le schéma de validation
+
+### 4. Utiliser les composants de base pour layouts personnalisés
+
+Les composants de base vous donnent un contrôle complet sur le markup :
+
+```gts
+
+
+
+
+ {{#if I.errors}}
+
+ {{#each I.errors as |error|}}
+
{{error.message}}
+ {{/each}}
+
+ {{/if}}
+
+
+ Soumettre
+
+```
+
+### 5. Comportement de validation
+
+#### Validation Réactive (Défaut)
+
+Quand `@reactive={{true}}` (défaut), les champs sont validés dès que leurs valeurs changent :
+
+```gts
+
+ {{! Le champ se valide à chaque changement }}
+
+
+```
+
+#### Validation uniquement à la soumission
+
+Définissez `@reactive={{false}}` pour valider uniquement quand le formulaire est soumis :
+
+```gts
+
+ {{! Le champ se valide uniquement à la soumission }}
+
+
+```
+
+### 6. Gestion des erreurs et scroll automatique
+
+Contrôlez l'effacement des erreurs et le comportement de scroll automatique :
+
+```gts
+
+ {{! Erreurs effacées avant validation, scroll vers la première erreur }}
+
+
+
+```
+
+### 7. État désactivé
+
+Désactivez tout le formulaire et tous ses inputs :
+
+```gts
+
+ {{! Tous les inputs seront désactivés quand isLoading est true }}
+
+
+```
+
+### 8. Travailler avec les champs requis
+
+Accédez à la liste des champs requis depuis le schéma de validation :
+
+```gts
+
+ Champs requis : {{F.requiredFields.length}}
+
+
+
+ {{#if (includes F.requiredFields "email")}}
+ L'email est requis
+ {{/if}}
+
+
+```
+
+### 9. Helper changesetGet
+
+Utilisez le helper `changesetGet` pour récupérer des valeurs sans répéter l'argument `@changeset` :
+
+```gts
+
+
+
+
+ Nom complet : {{F.changesetGet "firstName"}} {{F.changesetGet "lastName"}}
+
+```
+
+### 10. Exemple de formulaire complexe
+
+```typescript
+// Controller
+import Controller from '@ember/controller';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import { object, string, number, boolean, date } from 'zod';
+import { action } from '@ember/object';
+import { tracked } from '@glimmer/tracking';
+
+export default class ComplexFormController extends Controller {
+ @tracked isSubmitting = false;
+
+ changeset = new ImmerChangeset({
+ firstName: '',
+ lastName: '',
+ email: '',
+ phone: '',
+ birthday: null,
+ country: null,
+ subscribe: false,
+ });
+
+ validationSchema = object({
+ firstName: string().min(2),
+ lastName: string().min(2),
+ email: string().email(),
+ phone: string().optional(),
+ birthday: date(),
+ country: string().min(2),
+ subscribe: boolean(),
+ });
+
+ countryOptions = [
+ { label: 'Belgique', value: 'BE' },
+ { label: 'France', value: 'FR' },
+ { label: 'Pays-Bas', value: 'NL' },
+ ];
+
+ @action
+ async handleSubmit(validatedData, changeset) {
+ this.isSubmitting = true;
+ try {
+ await this.saveUser(validatedData);
+ alert('Utilisateur sauvegardé avec succès!');
+ } catch (error) {
+ console.error('Échec de la sauvegarde:', error);
+ } finally {
+ this.isSubmitting = false;
+ }
+ }
+}
+```
+
+```gts
+{{! Template }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{if this.isSubmitting "Sauvegarde..." "Sauvegarder l'utilisateur"}}
+
+
+```
+
+## Personnalisation des composants par défaut
+
+Les composants yieldés par défaut sont les composants de validation standard (`TpkValidation*`), mais vous pouvez changer ces composants par défaut en modifiant les valeurs dans le service TpkForm.
+
+```typescript
+let tpkFormService = this.owner.lookup('service:tpk-form') as TpkFormService;
+
+// Composants de base
+tpkFormService.TpkInput = CustomInput;
+tpkFormService.TpkTextarea = CustomTextarea;
+tpkFormService.TpkSelect = CustomSelect;
+tpkFormService.TpkCheckbox = CustomCheckbox;
+tpkFormService.TpkRadio = CustomRadio;
+tpkFormService.TpkRadioGroup = CustomRadioGroup;
+tpkFormService.TpkFile = CustomFile;
+tpkFormService.TpkDatepicker = CustomDatepicker;
+
+// Composants Prefab
+tpkFormService.TpkInputPrefab = CustomInputPrefab;
+tpkFormService.TpkTextareaPrefab = CustomTextareaPrefab;
+tpkFormService.TpkSelectPrefab = CustomSelectPrefab;
+tpkFormService.TpkSelectCreatePrefab = CustomSelectCreatePrefab;
+tpkFormService.TpkSelectSearchPrefab = CustomSelectSearchPrefab;
+tpkFormService.TpkCheckboxPrefab = CustomCheckboxPrefab;
+tpkFormService.TpkRadioPrefab = CustomRadioPrefab;
+tpkFormService.TpkRadioGroupPrefab = CustomRadioGroupPrefab;
+tpkFormService.TpkDatepickerPrefab = CustomDatepickerPrefab;
+tpkFormService.TpkDatepickerRangePrefab = CustomDatepickerRangePrefab;
+tpkFormService.TpkTimepickerPrefab = CustomTimepickerPrefab;
+
+// Inputs Prefab Spécialisés
+tpkFormService.TpkPasswordPrefab = CustomPasswordPrefab;
+tpkFormService.TpkEmailPrefab = CustomEmailPrefab;
+tpkFormService.TpkIbanPrefab = CustomIbanPrefab;
+tpkFormService.TpkBicPrefab = CustomBicPrefab;
+tpkFormService.TpkVatPrefab = CustomVatPrefab;
+tpkFormService.TpkNationalNumberPrefab = CustomNationalNumberPrefab;
+tpkFormService.TpkCurrencyPrefab = CustomCurrencyPrefab;
+tpkFormService.TpkIntegerPrefab = CustomIntegerPrefab;
+tpkFormService.TpkNumberPrefab = CustomNumberPrefab;
+tpkFormService.TpkMobilePrefab = CustomMobilePrefab;
+tpkFormService.TpkFilePrefab = CustomFilePrefab;
+```
+
+Cette personnalisation vous permet de remplacer les composants par défaut par vos propres implémentations tout en conservant la structure et le comportement du formulaire.
+
+## Fonctionnalités clés
+
+1. **Validation automatique**: S'intègre parfaitement avec les schémas Zod pour des règles de validation complètes.
+2. **Gestion des erreurs**: Affiche automatiquement les erreurs de validation et les efface au besoin.
+3. **Intégration Changeset**: Utilise `ember-immer-changeset` pour une gestion d'état efficace et le suivi des changements.
+4. **Bibliothèque riche de composants**: Fournit 30+ composants input pré-configurés pour les cas d'usage courants.
+5. **Validation flexible**: Supporte les modes de validation réactive (on-change) et uniquement à la soumission.
+6. **Accessibilité**: Scroll automatique vers les erreurs et gestion appropriée des états de focus.
+7. **Sécurité de typage**: Support complet TypeScript avec paramètres de type génériques pour l'inférence de schéma.
+8. **Personnalisable**: Peut remplacer les composants par défaut via le service TpkForm.
+
+## Notes importantes
+
+- Le callback `@onSubmit` n'est exécuté que quand le formulaire est valide.
+- Par défaut, le changeset est automatiquement exécuté (changements appliqués) avant d'appeler `@onSubmit`. Définissez `@executeOnValid={{false}}` pour empêcher cela.
+- Tous les composants yieldés sont pré-liés avec le changeset, l'état disabled et la liste des champs requis.
+- Le schéma de validation doit utiliser Zod (pas Yup, qui était utilisé dans les anciennes versions).
+- Les noms de champs dans le schéma de validation doivent correspondre aux valeurs `@validationField` utilisées dans les inputs du formulaire.
+- Le composant gère automatiquement le calcul des champs requis basé sur le schéma Zod et met à jour la liste quand les données changent.
diff --git a/doc-app/app/templates/docs/ember-input-validation/tpk-form.md b/doc-app/public/docs/ember-ui/prefabs/tpk-form.md
similarity index 51%
rename from doc-app/app/templates/docs/ember-input-validation/tpk-form.md
rename to doc-app/public/docs/ember-ui/prefabs/tpk-form.md
index a025b45e..435d370b 100644
--- a/doc-app/app/templates/docs/ember-input-validation/tpk-form.md
+++ b/doc-app/public/docs/ember-ui/prefabs/tpk-form.md
@@ -6,52 +6,53 @@ The `TpkForm` component is a form component that uses the `ember-immer-changeset
By default, the changeset is [executed](https://triptyk.github.io/ember-immer-changeset/classes/ImmerChangeset.html#execute) if the form submitted is valid.
-
-
-
-
-
- {{#if I.errors}}
- {{#each I.errors as |error|}}
- {{error.message}}
- {{/each}}
- {{/if}}
-
-
-
-
- Submit
-
-
-
-
+
+
+
+
+
+{{#if I.errors}}
+{{#each I.errors as |error|}}
+
+{{error.message}}
+{{/each}}
+{{/if}}
+
+
+
+
+Submit
+
+
+
+
-
## Arguments
-| Argument | Type | Default | Description |
-| --- | --- | --- | --- |
-| changeset | [ImmerChangeset](https://triptyk.github.io/ember-immer-changeset/classes/ImmerChangeset.html) | | The changeset to use for the form |
-| onSubmit | Function | | The function to execute when the form is submitted and valid. The changeset is the only argument passed to this function |
-| validationSchema | [Yup Object](https://www.npmjs.com/package/yup) | | The yup validation schema to use for the form |
-| reactive | Boolean | true | Whether or not the form should be reactive (a.k.a. validate the changeset on value change) |
-| executeOnValid | Boolean | true | Whether or not the changeset should be executed if the form is valid |
-| disabled | Boolean | false | Whether or not the form and the inputs should be disabled |
-| removeErrorsOnSubmit | Boolean | true | Whether or not the errors should be removed when the form is submitted |
-| autoScrollOnError | Boolean | true | Whether or not the form should scroll to the first error when the form is submitted |
+| Argument | Type | Default | Description |
+| -------------------- | --------------------------------------------------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------ |
+| changeset | [ImmerChangeset](https://triptyk.github.io/ember-immer-changeset/classes/ImmerChangeset.html) | | The changeset to use for the form |
+| onSubmit | Function | | The function to execute when the form is submitted and valid. The changeset is the only argument passed to this function |
+| validationSchema | [Yup Object](https://www.npmjs.com/package/yup) | | The yup validation schema to use for the form |
+| reactive | Boolean | true | Whether or not the form should be reactive (a.k.a. validate the changeset on value change) |
+| executeOnValid | Boolean | true | Whether or not the changeset should be executed if the form is valid |
+| disabled | Boolean | false | Whether or not the form and the inputs should be disabled |
+| removeErrorsOnSubmit | Boolean | true | Whether or not the errors should be removed when the form is submitted |
+| autoScrollOnError | Boolean | true | Whether or not the form should scroll to the first error when the form is submitted |
## Yielded Components
The `TpkForm` component yields the following components:
### Base Components
+
- TpkValidationInput yielded as `TpkInput`
- TpkValidationTextarea yielded as `TpkTextarea`
- TpkValidationSelect yielded as `TpkSelect`
@@ -62,6 +63,7 @@ The `TpkForm` component yields the following components:
- TpkValidationDatePicker yielded as `TpkDatepicker`
### Prefab Components
+
- TpkValidationInputPrefab yielded as `TpkInputPrefab`
- TpkValidationTextareaPrefab yielded as `TpkTextareaPrefab`
- TpkValidationSelectPrefab yielded as `TpkSelectPrefab`
@@ -75,6 +77,7 @@ The `TpkForm` component yields the following components:
- TpkValidationTimepickerPrefab yielded as `TpkTimepickerPrefab`
### Specialized Input Prefabs
+
- TpkValidationPasswordPrefab yielded as `TpkPasswordPrefab`
- TpkValidationEmailPrefab yielded as `TpkEmailPrefab`
- TpkValidationIBANPrefab yielded as `TpkIbanPrefab`
@@ -100,9 +103,7 @@ The `TpkForm` component yields the following values:
The default yielded components are TpkValidation` ` , but you can change the default components by changing the values in the TpkForm service.
```ts
-let tpkFormService = this.owner.lookup(
- 'service:tpk-form',
-) as TpkFormService;
+let tpkFormService = this.owner.lookup('service:tpk-form') as TpkFormService;
// Base Components
tpkFormService.TpkInput = DummyInput;
@@ -144,51 +145,54 @@ tpkFormService.TpkFilePrefab = DummyFilePrefab;
## Validation Behavior
The form handles validation in two ways:
+
- On submit: The entire form is validated when submitted
- On field change: If `@reactive={{true}}` (default), fields are validated individually when their values change
When validation errors occur:
+
- If `@autoScrollOnError={{true}}` (default), the form will automatically scroll to the first error
- If `@removeErrorsOnSubmit={{true}}` (default), existing errors are cleared before new validation on submit
## Complete example of using TpkForm
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Submit
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Submit
+
+
+
+
diff --git a/doc-app/app/templates/docs/ember-ui/stack-list.md b/doc-app/public/docs/ember-ui/stack-list.md
similarity index 82%
rename from doc-app/app/templates/docs/ember-ui/stack-list.md
rename to doc-app/public/docs/ember-ui/stack-list.md
index 18355c51..e6ec3bd0 100644
--- a/doc-app/app/templates/docs/ember-ui/stack-list.md
+++ b/doc-app/public/docs/ember-ui/stack-list.md
@@ -3,39 +3,37 @@
Stack list content
-
-
-
- title - {{T.item}}
-
-
- content - {{C.item}} - {{ C.index }}
-
-
-
-
+
+
+
+title - {{T.item}}
+
+
+content - {{C.item}} - {{ C.index }}
+
+
+
+
### Args
**@titleForAdd**: A string parameter representing the label displayed beside the plus icon within the button.
-**@onAdd**: A function parameter. This is function called when you click the
+**@onAdd**: A function parameter. This is function called when you click the
"add element to list" button. This function should add an element to the array
used as the data args.
-**@onRemove**: A function parameter. This is function called when you click the
+**@onRemove**: A function parameter. This is function called when you click the
thrash icon in the "element added" header. This function should remove an element from the array.
**@data**: An array parameter. It represents the array that contains each element displayed in the stack-list. If there's no element, nothing is displayed except the "add element to list" button.
-
### Yields
**S.Title**: The HTML element that is displayed when the stack list element is closed. You can use T.item within S.title. item is an element of the array
@@ -61,5 +59,3 @@ thrash icon in the "element added" header. This function should remove an elemen
**.origin-top**: CSS class for styling the body of each element in the stack list.
**.tpk-stack-head-expand-btn**: CSS class for styling the button that expands or collapses the body of each element in the stack list.
-
-
diff --git a/doc-app/public/docs/ember-ui/table-generic.md b/doc-app/public/docs/ember-ui/table-generic.md
new file mode 100644
index 00000000..e9f05342
--- /dev/null
+++ b/doc-app/public/docs/ember-ui/table-generic.md
@@ -0,0 +1,47 @@
+# Table generic
+
+A table component.
+
+
+
+
+
+
+
+
+Firstname
+
+
+Lastname
+
+
+Email
+
+
+
+
+{{element.firstName}}
+
+
+{{element.lastName}}
+
+
+{{element.email}}
+
+
+
+Delete
+
+
+
+
+
+
+
+
+
diff --git a/doc-app/app/templates/docs/index.md b/doc-app/public/docs/index.md
similarity index 97%
rename from doc-app/app/templates/docs/index.md
rename to doc-app/public/docs/index.md
index ff1dcd09..f7ae7a27 100644
--- a/doc-app/app/templates/docs/index.md
+++ b/doc-app/public/docs/index.md
@@ -9,8 +9,9 @@ This library is organized into three main packages:
### @triptyk/ember-input
Provides composable input components for building forms:
+
- Text inputs, textareas, and specialized inputs
-- Checkboxes and radio buttons
+- Checkboxes and radio buttons
- Select dropdowns and searchable selects
- File inputs and date pickers
- Toggle switches and buttons
@@ -20,6 +21,7 @@ Provides composable input components for building forms:
### @triptyk/ember-input-validation
Builds on ember-input with form validation capabilities:
+
- Validation-enabled versions of all input components
- TpkForm component for managing form state
- Integration with changesets for data validation
@@ -30,6 +32,7 @@ Builds on ember-input with form validation capabilities:
### @triptyk/ember-ui
Provides higher-level UI components:
+
- Modal dialogs and confirm modals
- Data tables with sorting and pagination
- Stack lists for managing collections
diff --git a/doc-app/public/mockServiceWorker.js b/doc-app/public/mockServiceWorker.js
index 1f45c4cf..cdbccc78 100644
--- a/doc-app/public/mockServiceWorker.js
+++ b/doc-app/public/mockServiceWorker.js
@@ -1,220 +1,243 @@
-/* eslint-disable */
-/* tslint:disable */
-
/**
- * Mock Service Worker (1.3.5).
+ * Mock Service Worker.
* @see https://github.com/mswjs/msw
* - Please do NOT modify this file.
- * - Please do NOT serve this file on production.
*/
-const INTEGRITY_CHECKSUM = '3d6b9f06410d179a7f7404d4bf4c3c70'
-const activeClientIds = new Set()
+const PACKAGE_VERSION = '2.12.7';
+const INTEGRITY_CHECKSUM = '4db4a41e972cec1b64cc569c66952d82';
+const IS_MOCKED_RESPONSE = Symbol('isMockedResponse');
+const activeClientIds = new Set();
-self.addEventListener('install', function () {
- self.skipWaiting()
-})
+addEventListener('install', function () {
+ self.skipWaiting();
+});
-self.addEventListener('activate', function (event) {
- event.waitUntil(self.clients.claim())
-})
+addEventListener('activate', function (event) {
+ event.waitUntil(self.clients.claim());
+});
-self.addEventListener('message', async function (event) {
- const clientId = event.source.id
+addEventListener('message', async function (event) {
+ const clientId = Reflect.get(event.source || {}, 'id');
if (!clientId || !self.clients) {
- return
+ return;
}
- const client = await self.clients.get(clientId)
+ const client = await self.clients.get(clientId);
if (!client) {
- return
+ return;
}
const allClients = await self.clients.matchAll({
type: 'window',
- })
+ });
switch (event.data) {
case 'KEEPALIVE_REQUEST': {
sendToClient(client, {
type: 'KEEPALIVE_RESPONSE',
- })
- break
+ });
+ break;
}
case 'INTEGRITY_CHECK_REQUEST': {
sendToClient(client, {
type: 'INTEGRITY_CHECK_RESPONSE',
- payload: INTEGRITY_CHECKSUM,
- })
- break
+ payload: {
+ packageVersion: PACKAGE_VERSION,
+ checksum: INTEGRITY_CHECKSUM,
+ },
+ });
+ break;
}
case 'MOCK_ACTIVATE': {
- activeClientIds.add(clientId)
+ activeClientIds.add(clientId);
sendToClient(client, {
type: 'MOCKING_ENABLED',
- payload: true,
- })
- break
- }
-
- case 'MOCK_DEACTIVATE': {
- activeClientIds.delete(clientId)
- break
+ payload: {
+ client: {
+ id: client.id,
+ frameType: client.frameType,
+ },
+ },
+ });
+ break;
}
case 'CLIENT_CLOSED': {
- activeClientIds.delete(clientId)
+ activeClientIds.delete(clientId);
const remainingClients = allClients.filter((client) => {
- return client.id !== clientId
- })
+ return client.id !== clientId;
+ });
// Unregister itself when there are no more clients
if (remainingClients.length === 0) {
- self.registration.unregister()
+ self.registration.unregister();
}
- break
+ break;
}
}
-})
-
-self.addEventListener('fetch', function (event) {
- const { request } = event
- const accept = request.headers.get('accept') || ''
+});
- // Bypass server-sent events.
- if (accept.includes('text/event-stream')) {
- return
- }
+addEventListener('fetch', function (event) {
+ const requestInterceptedAt = Date.now();
// Bypass navigation requests.
- if (request.mode === 'navigate') {
- return
+ if (event.request.mode === 'navigate') {
+ return;
}
// Opening the DevTools triggers the "only-if-cached" request
// that cannot be handled by the worker. Bypass such requests.
- if (request.cache === 'only-if-cached' && request.mode !== 'same-origin') {
- return
+ if (
+ event.request.cache === 'only-if-cached' &&
+ event.request.mode !== 'same-origin'
+ ) {
+ return;
}
// Bypass all requests when there are no active clients.
// Prevents the self-unregistered worked from handling requests
- // after it's been deleted (still remains active until the next reload).
+ // after it's been terminated (still remains active until the next reload).
if (activeClientIds.size === 0) {
- return
+ return;
}
- // Generate unique request ID.
- const requestId = Math.random().toString(16).slice(2)
-
- event.respondWith(
- handleRequest(event, requestId).catch((error) => {
- if (error.name === 'NetworkError') {
- console.warn(
- '[MSW] Successfully emulated a network error for the "%s %s" request.',
- request.method,
- request.url,
- )
- return
- }
+ const requestId = crypto.randomUUID();
+ event.respondWith(handleRequest(event, requestId, requestInterceptedAt));
+});
- // At this point, any exception indicates an issue with the original request/response.
- console.error(
- `\
-[MSW] Caught an exception from the "%s %s" request (%s). This is probably not a problem with Mock Service Worker. There is likely an additional logging output above.`,
- request.method,
- request.url,
- `${error.name}: ${error.message}`,
- )
- }),
- )
-})
-
-async function handleRequest(event, requestId) {
- const client = await resolveMainClient(event)
- const response = await getResponse(event, client, requestId)
+/**
+ * @param {FetchEvent} event
+ * @param {string} requestId
+ * @param {number} requestInterceptedAt
+ */
+async function handleRequest(event, requestId, requestInterceptedAt) {
+ const client = await resolveMainClient(event);
+ const requestCloneForEvents = event.request.clone();
+ const response = await getResponse(
+ event,
+ client,
+ requestId,
+ requestInterceptedAt
+ );
// Send back the response clone for the "response:*" life-cycle events.
// Ensure MSW is active and ready to handle the message, otherwise
// this message will pend indefinitely.
if (client && activeClientIds.has(client.id)) {
- ;(async function () {
- const clonedResponse = response.clone()
- sendToClient(client, {
+ const serializedRequest = await serializeRequest(requestCloneForEvents);
+
+ // Clone the response so both the client and the library could consume it.
+ const responseClone = response.clone();
+
+ sendToClient(
+ client,
+ {
type: 'RESPONSE',
payload: {
- requestId,
- type: clonedResponse.type,
- ok: clonedResponse.ok,
- status: clonedResponse.status,
- statusText: clonedResponse.statusText,
- body:
- clonedResponse.body === null ? null : await clonedResponse.text(),
- headers: Object.fromEntries(clonedResponse.headers.entries()),
- redirected: clonedResponse.redirected,
+ isMockedResponse: IS_MOCKED_RESPONSE in response,
+ request: {
+ id: requestId,
+ ...serializedRequest,
+ },
+ response: {
+ type: responseClone.type,
+ status: responseClone.status,
+ statusText: responseClone.statusText,
+ headers: Object.fromEntries(responseClone.headers.entries()),
+ body: responseClone.body,
+ },
},
- })
- })()
+ },
+ responseClone.body ? [serializedRequest.body, responseClone.body] : []
+ );
}
- return response
+ return response;
}
-// Resolve the main client for the given event.
-// Client that issues a request doesn't necessarily equal the client
-// that registered the worker. It's with the latter the worker should
-// communicate with during the response resolving phase.
+/**
+ * Resolve the main client for the given event.
+ * Client that issues a request doesn't necessarily equal the client
+ * that registered the worker. It's with the latter the worker should
+ * communicate with during the response resolving phase.
+ * @param {FetchEvent} event
+ * @returns {Promise}
+ */
async function resolveMainClient(event) {
- const client = await self.clients.get(event.clientId)
+ const client = await self.clients.get(event.clientId);
+
+ if (activeClientIds.has(event.clientId)) {
+ return client;
+ }
if (client?.frameType === 'top-level') {
- return client
+ return client;
}
const allClients = await self.clients.matchAll({
type: 'window',
- })
+ });
return allClients
.filter((client) => {
// Get only those clients that are currently visible.
- return client.visibilityState === 'visible'
+ return client.visibilityState === 'visible';
})
.find((client) => {
// Find the client ID that's recorded in the
// set of clients that have registered the worker.
- return activeClientIds.has(client.id)
- })
+ return activeClientIds.has(client.id);
+ });
}
-async function getResponse(event, client, requestId) {
- const { request } = event
- const clonedRequest = request.clone()
+/**
+ * @param {FetchEvent} event
+ * @param {Client | undefined} client
+ * @param {string} requestId
+ * @param {number} requestInterceptedAt
+ * @returns {Promise}
+ */
+async function getResponse(event, client, requestId, requestInterceptedAt) {
+ // Clone the request because it might've been already used
+ // (i.e. its body has been read and sent to the client).
+ const requestClone = event.request.clone();
function passthrough() {
- // Clone the request because it might've been already used
- // (i.e. its body has been read and sent to the client).
- const headers = Object.fromEntries(clonedRequest.headers.entries())
-
- // Remove MSW-specific request headers so the bypassed requests
- // comply with the server's CORS preflight check.
- // Operate with the headers as an object because request "Headers"
- // are immutable.
- delete headers['x-msw-bypass']
+ // Cast the request headers to a new Headers instance
+ // so the headers can be manipulated with.
+ const headers = new Headers(requestClone.headers);
+
+ // Remove the "accept" header value that marked this request as passthrough.
+ // This prevents request alteration and also keeps it compliant with the
+ // user-defined CORS policies.
+ const acceptHeader = headers.get('accept');
+ if (acceptHeader) {
+ const values = acceptHeader.split(',').map((value) => value.trim());
+ const filteredValues = values.filter(
+ (value) => value !== 'msw/passthrough'
+ );
+
+ if (filteredValues.length > 0) {
+ headers.set('accept', filteredValues.join(', '));
+ } else {
+ headers.delete('accept');
+ }
+ }
- return fetch(clonedRequest, { headers })
+ return fetch(requestClone, { headers });
}
// Bypass mocking when the client is not active.
if (!client) {
- return passthrough()
+ return passthrough();
}
// Bypass initial page load requests (i.e. static assets).
@@ -222,82 +245,102 @@ async function getResponse(event, client, requestId) {
// means that MSW hasn't dispatched the "MOCK_ACTIVATE" event yet
// and is not ready to handle requests.
if (!activeClientIds.has(client.id)) {
- return passthrough()
- }
-
- // Bypass requests with the explicit bypass header.
- // Such requests can be issued by "ctx.fetch()".
- if (request.headers.get('x-msw-bypass') === 'true') {
- return passthrough()
+ return passthrough();
}
// Notify the client that a request has been intercepted.
- const clientMessage = await sendToClient(client, {
- type: 'REQUEST',
- payload: {
- id: requestId,
- url: request.url,
- method: request.method,
- headers: Object.fromEntries(request.headers.entries()),
- cache: request.cache,
- mode: request.mode,
- credentials: request.credentials,
- destination: request.destination,
- integrity: request.integrity,
- redirect: request.redirect,
- referrer: request.referrer,
- referrerPolicy: request.referrerPolicy,
- body: await request.text(),
- bodyUsed: request.bodyUsed,
- keepalive: request.keepalive,
+ const serializedRequest = await serializeRequest(event.request);
+ const clientMessage = await sendToClient(
+ client,
+ {
+ type: 'REQUEST',
+ payload: {
+ id: requestId,
+ interceptedAt: requestInterceptedAt,
+ ...serializedRequest,
+ },
},
- })
+ [serializedRequest.body]
+ );
switch (clientMessage.type) {
case 'MOCK_RESPONSE': {
- return respondWithMock(clientMessage.data)
+ return respondWithMock(clientMessage.data);
}
- case 'MOCK_NOT_FOUND': {
- return passthrough()
- }
-
- case 'NETWORK_ERROR': {
- const { name, message } = clientMessage.data
- const networkError = new Error(message)
- networkError.name = name
-
- // Rejecting a "respondWith" promise emulates a network error.
- throw networkError
+ case 'PASSTHROUGH': {
+ return passthrough();
}
}
- return passthrough()
+ return passthrough();
}
-function sendToClient(client, message) {
+/**
+ * @param {Client} client
+ * @param {any} message
+ * @param {Array} transferrables
+ * @returns {Promise}
+ */
+function sendToClient(client, message, transferrables = []) {
return new Promise((resolve, reject) => {
- const channel = new MessageChannel()
+ const channel = new MessageChannel();
channel.port1.onmessage = (event) => {
if (event.data && event.data.error) {
- return reject(event.data.error)
+ return reject(event.data.error);
}
- resolve(event.data)
- }
+ resolve(event.data);
+ };
- client.postMessage(message, [channel.port2])
- })
+ client.postMessage(message, [
+ channel.port2,
+ ...transferrables.filter(Boolean),
+ ]);
+ });
}
-function sleep(timeMs) {
- return new Promise((resolve) => {
- setTimeout(resolve, timeMs)
- })
+/**
+ * @param {Response} response
+ * @returns {Response}
+ */
+function respondWithMock(response) {
+ // Setting response status code to 0 is a no-op.
+ // However, when responding with a "Response.error()", the produced Response
+ // instance will have status code set to 0. Since it's not possible to create
+ // a Response instance with status code 0, handle that use-case separately.
+ if (response.status === 0) {
+ return Response.error();
+ }
+
+ const mockedResponse = new Response(response.body, response);
+
+ Reflect.defineProperty(mockedResponse, IS_MOCKED_RESPONSE, {
+ value: true,
+ enumerable: true,
+ });
+
+ return mockedResponse;
}
-async function respondWithMock(response) {
- await sleep(response.delay)
- return new Response(response.body, response)
+/**
+ * @param {Request} request
+ */
+async function serializeRequest(request) {
+ return {
+ url: request.url,
+ mode: request.mode,
+ method: request.method,
+ headers: Object.fromEntries(request.headers.entries()),
+ cache: request.cache,
+ credentials: request.credentials,
+ destination: request.destination,
+ integrity: request.integrity,
+ redirect: request.redirect,
+ referrer: request.referrer,
+ referrerPolicy: request.referrerPolicy,
+ body: await request.arrayBuffer(),
+ keepalive: request.keepalive,
+ };
}
diff --git a/doc-app/public/worker.js b/doc-app/public/worker.js
deleted file mode 100644
index 205ede1c..00000000
--- a/doc-app/public/worker.js
+++ /dev/null
@@ -1,3 +0,0 @@
-import { setupWorker } from 'msw';
-
-export const worker = (handlers) => setupWorker(...handlers);
diff --git a/doc-app/tailwind.config.js b/doc-app/tailwind.config.js
deleted file mode 100644
index 9a6b4745..00000000
--- a/doc-app/tailwind.config.js
+++ /dev/null
@@ -1,19 +0,0 @@
-const path = require('path');
-
-/** @type {import('tailwindcss').Config} */
-module.exports = {
- content: [
- './app/**/*.{gjs,gts,hbs,html,js,ts}',
- path.join(
- path.dirname(require.resolve('@triptyk/ember-input-validation')),
- '**/*.{gts,gjs,ts,js,css}',
- ),
- ],
- theme: {
- extend: {},
- },
- daisyui: {
- themes: ['light'],
- },
- plugins: [require('daisyui')],
-};
diff --git a/doc-app/testem.cjs b/doc-app/testem.cjs
new file mode 100644
index 00000000..b4b6691f
--- /dev/null
+++ b/doc-app/testem.cjs
@@ -0,0 +1,25 @@
+'use strict';
+
+if (typeof module !== 'undefined') {
+ module.exports = {
+ test_page: 'tests/index.html?hidepassed',
+ disable_watching: true,
+ launch_in_ci: ['Chrome'],
+ launch_in_dev: ['Chrome'],
+ browser_start_timeout: 120,
+ browser_args: {
+ Chrome: {
+ ci: [
+ // --no-sandbox is needed when running Chrome inside a container
+ process.env.CI ? '--no-sandbox' : null,
+ '--headless',
+ '--disable-dev-shm-usage',
+ '--disable-software-rasterizer',
+ '--mute-audio',
+ '--remote-debugging-port=0',
+ '--window-size=1440,900',
+ ].filter(Boolean),
+ },
+ },
+ };
+}
diff --git a/doc-app/testem.js b/doc-app/testem.js
deleted file mode 100644
index a2d0e08f..00000000
--- a/doc-app/testem.js
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-module.exports = {
- test_page: 'tests/index.html?hidepassed',
- disable_watching: true,
- launch_in_ci: ['Chrome'],
- launch_in_dev: ['Chrome'],
- browser_start_timeout: 120,
- browser_args: {
- Chrome: {
- ci: [
- // --no-sandbox is needed when running Chrome inside a container
- process.env.CI ? '--no-sandbox' : null,
- '--headless',
- '--disable-dev-shm-usage',
- '--disable-software-rasterizer',
- '--mute-audio',
- '--remote-debugging-port=0',
- '--window-size=1440,900',
- ].filter(Boolean),
- },
- },
-};
diff --git a/doc-app/tests/index.html b/doc-app/tests/index.html
index 9051fb38..ef8aad47 100644
--- a/doc-app/tests/index.html
+++ b/doc-app/tests/index.html
@@ -2,21 +2,20 @@
- DocApp Tests
+ Blueprint Tests
{{content-for "head"}}
{{content-for "test-head"}}
-
-
-
+
+
{{content-for "head-footer"}}
{{content-for "test-head-footer"}}
-
+
{{content-for "body"}}
{{content-for "test-body"}}
@@ -28,12 +27,16 @@
-
-
-
-
+
+
+
+
+
{{content-for "body-footer"}}
- {{content-for "test-body-footer"}}
diff --git a/doc-app/tests/integration/components/ember-input-validation/generic-test-functions/assert-data-has-error-attribute.ts b/doc-app/tests/integration/components/ember-input-validation/generic-test-functions/assert-data-has-error-attribute.ts
index 153f19d4..fce96ab0 100644
--- a/doc-app/tests/integration/components/ember-input-validation/generic-test-functions/assert-data-has-error-attribute.ts
+++ b/doc-app/tests/integration/components/ember-input-validation/generic-test-functions/assert-data-has-error-attribute.ts
@@ -1,10 +1,10 @@
-import { settled } from "@ember/test-helpers";
-import type ImmerChangeset from "ember-immer-changeset";
+import { settled } from '@ember/test-helpers';
+import type ImmerChangeset from 'ember-immer-changeset';
export async function assertDataHasErrorAttribute(
assert: Assert,
changeset: ImmerChangeset,
- input: string,
+ input: string
) {
changeset.addError({
message: 'required',
diff --git a/doc-app/tests/integration/components/ember-input-validation/generic-test-functions/assert-tpk-css-classes-exist.ts b/doc-app/tests/integration/components/ember-input-validation/generic-test-functions/assert-tpk-css-classes-exist.ts
index bc142d3f..06798b2e 100644
--- a/doc-app/tests/integration/components/ember-input-validation/generic-test-functions/assert-tpk-css-classes-exist.ts
+++ b/doc-app/tests/integration/components/ember-input-validation/generic-test-functions/assert-tpk-css-classes-exist.ts
@@ -1,14 +1,27 @@
-export async function assertTpkCssClassesExist(
- assert: Assert,
- input: string,
- inputType: 'input' | 'textarea' = 'input'
+export function assertTpkCssClassesExist(
+ assert: Assert,
+ input: string,
+ inputType: 'input' | 'textarea' = 'input'
) {
- assert.dom(`.tpk-${input}-container`).exists().hasAttribute(`data-test-tpk-prefab-${input}-container`);
- assert.dom(`.tpk-${input}-container .tpk-${input}-input`).exists()
- assert.dom(`.tpk-${input}-container .tpk-validation-errors`).exists()
- assert.dom(`.tpk-${input}-container .tpk-label`).exists()
- assert.dom(`label`).hasClass(`tpk-${input}-container`);
- assert.dom(inputType).hasClass(`tpk-${input}-input`);
- assert.dom(`label > div:first-of-type`).hasClass(`tpk-label`, `The first div inside label has the class tpk-label.`);
- assert.dom(`label > div:last-of-type`).hasClass(`tpk-validation-errors`, `The second div inside label has the class tpk-validation-errors.`);
+ assert
+ .dom(`.tpk-${input}-container`)
+ .exists()
+ .hasAttribute(`data-test-tpk-prefab-${input}-container`);
+ assert.dom(`.tpk-${input}-container .tpk-${input}-input`).exists();
+ assert.dom(`.tpk-${input}-container .tpk-validation-errors`).exists();
+ assert.dom(`.tpk-${input}-container .tpk-label`).exists();
+ assert.dom(`label`).hasClass(`tpk-${input}-container`);
+ assert.dom(inputType).hasClass(`tpk-${input}-input`);
+ assert
+ .dom(`label > div:first-of-type`)
+ .hasClass(
+ `tpk-label`,
+ `The first div inside label has the class tpk-label.`
+ );
+ assert
+ .dom(`label > div:last-of-type`)
+ .hasClass(
+ `tpk-validation-errors`,
+ `The second div inside label has the class tpk-validation-errors.`
+ );
}
diff --git a/doc-app/tests/integration/components/ember-input-validation/generic-test-functions/initialize-params-tpk-form.ts b/doc-app/tests/integration/components/ember-input-validation/generic-test-functions/initialize-params-tpk-form.ts
index 2c77508a..a2c04a4f 100644
--- a/doc-app/tests/integration/components/ember-input-validation/generic-test-functions/initialize-params-tpk-form.ts
+++ b/doc-app/tests/integration/components/ember-input-validation/generic-test-functions/initialize-params-tpk-form.ts
@@ -1,10 +1,10 @@
import { ImmerChangeset } from 'ember-immer-changeset';
-import { object, type Schema } from 'yup';
+import { object, ZodObject } from 'zod';
export interface TpkFormParams {
changeset?: ImmerChangeset;
onSubmit?: (...args: unknown[]) => void;
- validationSchema?: Schema;
+ validationSchema?: ZodObject;
reactive?: boolean;
removeErrorsOnSubmit?: boolean;
autoScrollOnError?: boolean;
diff --git a/doc-app/tests/integration/components/ember-input-validation/generic-test-functions/setup-prefab-component.gts b/doc-app/tests/integration/components/ember-input-validation/generic-test-functions/setup-prefab-component.gts
index 6bdbc0dd..ed385a88 100644
--- a/doc-app/tests/integration/components/ember-input-validation/generic-test-functions/setup-prefab-component.gts
+++ b/doc-app/tests/integration/components/ember-input-validation/generic-test-functions/setup-prefab-component.gts
@@ -1,15 +1,28 @@
-import { render } from "@ember/test-helpers";
-import { initializeParams, type TpkFormParams } from './initialize-params-tpk-form';
+import { render } from '@ember/test-helpers';
+import {
+ initializeParams,
+ type TpkFormParams,
+} from './initialize-params-tpk-form';
import TpkForm from '@triptyk/ember-input-validation/components/tpk-form';
export async function setupCompletePrefabComponent(params?: TpkFormParams) {
- const { changeset, onSubmit, validationSchema, reactive, removeErrorsOnSubmit, autoScrollOnError, executeOnValid } = initializeParams(params);
+ const {
+ changeset,
+ onSubmit,
+ validationSchema,
+ reactive,
+ removeErrorsOnSubmit,
+ autoScrollOnError,
+ executeOnValid,
+ } = initializeParams(params);
const selectOptions = ['option1', 'option2'];
const onCreate = () => {};
- const onSearch = () => {};
+ const onSearch = () => {
+ return [];
+ };
await render(
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ as |F|
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
Submit
@@ -48,54 +141,82 @@ export async function setupCompletePrefabComponent(params?: TpkFormParams) {
}
export async function setupComponent(params?: TpkFormParams) {
- const { changeset, onSubmit, validationSchema, reactive, removeErrorsOnSubmit, autoScrollOnError, executeOnValid } = initializeParams(params);
+ const {
+ changeset,
+ onSubmit,
+ validationSchema,
+ reactive,
+ removeErrorsOnSubmit,
+ autoScrollOnError,
+ executeOnValid,
+ } = initializeParams(params);
- await render(
-
+ await render(
+
-
-
-
-
-
- Submit
-
-
- );
+ @changeset={{changeset}}
+ @validationSchema={{validationSchema}}
+ @onSubmit={{onSubmit}}
+ @reactive={{reactive}}
+ @autoScrollOnError={{autoScrollOnError}}
+ @removeErrorsOnSubmit={{removeErrorsOnSubmit}}
+ @executeOnValid={{executeOnValid}}
+ as |F|
+ >
+
+
+
+
+
+ Submit
+
+
+ );
- return changeset;
- }
+ return changeset;
+}
export async function setupCurrencyDateComponent(params?: TpkFormParams) {
- const { changeset, onSubmit, validationSchema, reactive, removeErrorsOnSubmit, autoScrollOnError, executeOnValid } = initializeParams(params);
+ const {
+ changeset,
+ onSubmit,
+ validationSchema,
+ reactive,
+ removeErrorsOnSubmit,
+ autoScrollOnError,
+ executeOnValid,
+ } = initializeParams(params);
- await render(
-
+ await render(
+
-
-
-
-
- Submit
-
-
- );
+ @changeset={{changeset}}
+ @validationSchema={{validationSchema}}
+ @onSubmit={{onSubmit}}
+ @reactive={{reactive}}
+ @autoScrollOnError={{autoScrollOnError}}
+ @removeErrorsOnSubmit={{removeErrorsOnSubmit}}
+ @executeOnValid={{executeOnValid}}
+ as |F|
+ >
+
+
+
+
+ Submit
+
+
+ );
- return changeset;
- }
+ return changeset;
+}
diff --git a/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-bic-test.gts b/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-bic-test.gts
index b9f28b9a..f9349e65 100644
--- a/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-bic-test.gts
+++ b/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-bic-test.gts
@@ -23,13 +23,13 @@ module(
await render(
-
- ,
+ />
+
);
return immerChangeset;
}
@@ -51,16 +51,16 @@ module(
});
test('It changes data-has-error attribute on error', async function (assert) {
- const changeset = await renderComponentAndReturnChangeset();
- await assertDataHasErrorAttribute(assert,changeset,'bic');
+ const changeset = await renderComponentAndReturnChangeset();
+ await assertDataHasErrorAttribute(assert, changeset, 'bic');
});
test('CSS classes exist and have been attached to the correct element', async function (assert) {
await renderComponentAndReturnChangeset();
- await assertTpkCssClassesExist(assert,'bic');
+ assertTpkCssClassesExist(assert, 'bic');
});
- test('@disabled disables the input', async function(assert) {
+ test('@disabled disables the input', async function (assert) {
await renderComponentAndReturnChangeset({
disabled: true,
});
@@ -74,5 +74,5 @@ module(
});
await a11yAudit();
});
- },
+ }
);
diff --git a/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-checkbox-test.gts b/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-checkbox-test.gts
index 802c3946..f81fed9d 100644
--- a/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-checkbox-test.gts
+++ b/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-checkbox-test.gts
@@ -1,6 +1,6 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
-import { render } from '@ember/test-helpers';
+import { render } from '@ember/test-helpers';
import { ImmerChangeset } from 'ember-immer-changeset';
import { setupIntl } from 'ember-intl/test-support';
import TpkValidationCheckbox from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-checkbox';
@@ -14,19 +14,22 @@ module(
setupRenderingTest(hooks);
setupIntl(hooks, 'fr-fr');
- async function renderComponent(changeset: ImmerChangeset, params?: {
- disabled?: boolean;
- }) {
+ async function renderComponent(
+ changeset: ImmerChangeset,
+ params?: {
+ disabled?: boolean;
+ }
+ ) {
await render(
- ,
+
);
}
@@ -48,16 +51,16 @@ module(
test('It changes data-has-error attribute on error', async function (assert) {
const changeset = setupChangeset();
await renderComponent(changeset);
- await assertDataHasErrorAttribute(assert,changeset,'checkbox');
+ await assertDataHasErrorAttribute(assert, changeset, 'checkbox');
});
- test('CSS classes exist and have been attached to the correct element', async function (assert) {
+ test('CSS classes exist and have been attached to the correct element', async function (assert) {
const changeset = setupChangeset();
await renderComponent(changeset);
- await assertTpkCssClassesExist(assert,'checkbox');
+ assertTpkCssClassesExist(assert, 'checkbox');
});
- test('@disabled disables the input', async function(assert) {
+ test('@disabled disables the input', async function (assert) {
const changeset = setupChangeset();
await renderComponent(changeset, {
disabled: true,
@@ -73,5 +76,5 @@ module(
});
await a11yAudit();
});
- },
+ }
);
diff --git a/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-currency-test.gts b/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-currency-test.gts
index 071c1bab..25cbae25 100644
--- a/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-currency-test.gts
+++ b/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-currency-test.gts
@@ -1,7 +1,6 @@
-
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
-import { fillIn, render } from '@ember/test-helpers';
+import { fillIn, render } from '@ember/test-helpers';
import { setupIntl } from 'ember-intl/test-support';
import { ImmerChangeset } from 'ember-immer-changeset';
import TpkValidationCurrency from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-currency';
@@ -9,7 +8,6 @@ import { assertTpkCssClassesExist } from '../generic-test-functions/assert-tpk-c
import { assertDataHasErrorAttribute } from '../generic-test-functions/assert-data-has-error-attribute';
import { a11yAudit } from 'ember-a11y-testing/test-support';
-
module(
'Integration | Component | Prefabs | tpk-validation-currency',
function (hooks) {
@@ -17,32 +15,30 @@ module(
setupIntl(hooks, 'fr-fr');
function setupChangeset() {
- return new ImmerChangeset({
+ return new ImmerChangeset({
currency: 123.56,
});
}
async function renderComponent(
changeset: ImmerChangeset,
- { scale = 2, disabled = false } = {},
+ { scale = 2, disabled = false } = {}
) {
-
- const onChange = (value: number) => {
+ const onChange = (value: string | number | Date | null) => {
changeset.set('currency', value);
};
await render(
- ,
+ @label="label"
+ @changeset={{changeset}}
+ @onChange={{onChange}}
+ @validationField="currency"
+ @scale={{scale}}
+ @disabled={{disabled}}
+ />
+
);
-
}
// currently, only euro is supported
@@ -58,13 +54,13 @@ module(
assert.dom('input').hasAttribute('type', 'text');
});
- test('Should set value as number', async function ( assert) {
+ test('Should set value as number', async function (assert) {
const changeset = setupChangeset();
await renderComponent(changeset);
assert.strictEqual(changeset.get('currency'), 123.56);
});
- test('Should set value as number when value change', async function ( assert) {
+ test('Should set value as number when value change', async function (assert) {
const changeset = setupChangeset();
await renderComponent(changeset);
await fillIn('input', '123.45');
@@ -74,7 +70,7 @@ module(
test('@scale should control the decimals of the input', async function (assert) {
const changeset = setupChangeset();
await renderComponent(changeset, {
- scale: 3
+ scale: 3,
});
assert.dom('[data-test-tpk-currency-input]').hasValue('123.560 €');
});
@@ -82,16 +78,16 @@ module(
test('Error prefab appears if an error is added to changeset', async function (assert) {
const changeset = setupChangeset();
await renderComponent(changeset);
- await assertDataHasErrorAttribute(assert,changeset,'currency');
+ await assertDataHasErrorAttribute(assert, changeset, 'currency');
});
test('CSS classes exist and have been attached to the correct element', async function (assert) {
const changeset = setupChangeset();
await renderComponent(changeset);
- await assertTpkCssClassesExist(assert,'currency');
+ assertTpkCssClassesExist(assert, 'currency');
});
- test('@disabled disables the input', async function(assert) {
+ test('@disabled disables the input', async function (assert) {
const changeset = setupChangeset();
await renderComponent(changeset, {
disabled: true,
@@ -107,5 +103,5 @@ module(
});
await a11yAudit();
});
- },
+ }
);
diff --git a/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-datepicker-range-test.gts b/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-datepicker-range-test.gts
index d3f4ea41..3598e236 100644
--- a/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-datepicker-range-test.gts
+++ b/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-datepicker-range-test.gts
@@ -9,7 +9,6 @@ import TpkValidationDatepickerRange from '@triptyk/ember-input-validation/compon
import { assertDataHasErrorAttribute } from '../generic-test-functions/assert-data-has-error-attribute';
import { a11yAudit } from 'ember-a11y-testing/test-support';
-
module(
'Integration | Component | Prefabs | tpk-validation-datepicker-range',
function (hooks) {
@@ -24,13 +23,13 @@ module(
});
await render(
-
- ,
+ />
+
);
return immerChangeset;
}
@@ -45,27 +44,46 @@ module(
});
test('It changes data-has-error attribute on error', async function (assert) {
- const changeset = await renderComponentAndReturnChangeset();
- await assertDataHasErrorAttribute(assert,changeset,'datepicker-range');
+ const changeset = await renderComponentAndReturnChangeset();
+ await assertDataHasErrorAttribute(assert, changeset, 'datepicker-range');
});
test('CSS classes exist and have been attached to the correct element', async function (assert) {
await renderComponentAndReturnChangeset();
- assert.dom(`.tpk-datepicker-range-container`).exists().hasAttribute(`data-test-tpk-prefab-datepicker-range-container`);
- assert.dom(`.tpk-datepicker-range-container .tpk-datepicker-range-input`).exists()
- assert.dom(`.tpk-datepicker-range-container .tpk-validation-errors`).exists()
- assert.dom(`.tpk-datepicker-range-container .tpk-label`).exists()
+ assert
+ .dom(`.tpk-datepicker-range-container`)
+ .exists()
+ .hasAttribute(`data-test-tpk-prefab-datepicker-range-container`);
+ assert
+ .dom(`.tpk-datepicker-range-container .tpk-datepicker-range-input`)
+ .exists();
+ assert
+ .dom(`.tpk-datepicker-range-container .tpk-validation-errors`)
+ .exists();
+ assert.dom(`.tpk-datepicker-range-container .tpk-label`).exists();
assert.dom('input').hasClass(`tpk-datepicker-range-input`);
- assert.dom(`label > div:first-of-type`).hasClass(`tpk-label`, `The first div inside label has the class tpk-label.`);
- assert.dom(`.tpk-datepicker-range-container > div:last-of-type`).hasClass(`tpk-validation-errors`, `The last div inside container has the class tpk-validation-errors.`);
+ assert
+ .dom(`label > div:first-of-type`)
+ .hasClass(
+ `tpk-label`,
+ `The first div inside label has the class tpk-label.`
+ );
+ assert
+ .dom(`.tpk-datepicker-range-container > div:last-of-type`)
+ .hasClass(
+ `tpk-validation-errors`,
+ `The last div inside container has the class tpk-validation-errors.`
+ );
});
- test('@disabled disables the input', async function(assert) {
+ test('@disabled disables the input', async function (assert) {
await renderComponentAndReturnChangeset({
disabled: true,
});
- assert.dom(`[data-test-tpk-datepicker-range-input]`).hasAttribute('disabled');
+ assert
+ .dom(`[data-test-tpk-datepicker-range-input]`)
+ .hasAttribute('disabled');
});
test('Accessibility', async function (assert) {
@@ -75,5 +93,5 @@ module(
});
await a11yAudit();
});
- },
+ }
);
diff --git a/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-datepicker-test.gts b/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-datepicker-test.gts
index 702f7b25..14b225a9 100644
--- a/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-datepicker-test.gts
+++ b/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-datepicker-test.gts
@@ -9,7 +9,6 @@ import TpkValidationDatepicker from '@triptyk/ember-input-validation/components/
import { assertDataHasErrorAttribute } from '../generic-test-functions/assert-data-has-error-attribute';
import { a11yAudit } from 'ember-a11y-testing/test-support';
-
module(
'Integration | Component | Prefabs | tpk-validation-datepicker',
function (hooks) {
@@ -20,17 +19,17 @@ module(
disabled?: boolean;
}) {
const immerChangeset = new ImmerChangeset({
- 'datepicker': null,
+ datepicker: null,
});
await render(
-
- ,
+ />
+
);
return immerChangeset;
}
@@ -43,23 +42,36 @@ module(
});
test('It changes data-has-error attribute on error', async function (assert) {
- const changeset = await renderComponentAndReturnChangeset();
- await assertDataHasErrorAttribute(assert,changeset,'datepicker');
+ const changeset = await renderComponentAndReturnChangeset();
+ await assertDataHasErrorAttribute(assert, changeset, 'datepicker');
});
test('CSS classes exist and have been attached to the correct element', async function (assert) {
await renderComponentAndReturnChangeset();
- assert.dom(`.tpk-datepicker-container`).exists().hasAttribute(`data-test-tpk-prefab-datepicker-container`);
- assert.dom(`.tpk-datepicker-container .tpk-datepicker-input`).exists()
- assert.dom(`.tpk-datepicker-container .tpk-validation-errors`).exists()
- assert.dom(`.tpk-datepicker-container .tpk-label`).exists()
+ assert
+ .dom(`.tpk-datepicker-container`)
+ .exists()
+ .hasAttribute(`data-test-tpk-prefab-datepicker-container`);
+ assert.dom(`.tpk-datepicker-container .tpk-datepicker-input`).exists();
+ assert.dom(`.tpk-datepicker-container .tpk-validation-errors`).exists();
+ assert.dom(`.tpk-datepicker-container .tpk-label`).exists();
assert.dom('input').hasClass(`tpk-datepicker-input`);
- assert.dom(`label > div:first-of-type`).hasClass(`tpk-label`, `The first div inside label has the class tpk-label.`);
- assert.dom(`.tpk-datepicker-container > div:last-of-type`).hasClass(`tpk-validation-errors`, `The last div inside container has the class tpk-validation-errors.`);
+ assert
+ .dom(`label > div:first-of-type`)
+ .hasClass(
+ `tpk-label`,
+ `The first div inside label has the class tpk-label.`
+ );
+ assert
+ .dom(`.tpk-datepicker-container > div:last-of-type`)
+ .hasClass(
+ `tpk-validation-errors`,
+ `The last div inside container has the class tpk-validation-errors.`
+ );
});
- test('@disabled disables the input', async function(assert) {
+ test('@disabled disables the input', async function (assert) {
await renderComponentAndReturnChangeset({
disabled: true,
});
@@ -73,5 +85,5 @@ module(
});
await a11yAudit();
});
- },
+ }
);
diff --git a/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-email-test.gts b/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-email-test.gts
index 8b5ed3d6..068e7038 100644
--- a/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-email-test.gts
+++ b/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-email-test.gts
@@ -8,57 +8,64 @@ import { assertTpkCssClassesExist } from '../generic-test-functions/assert-tpk-c
import { assertDataHasErrorAttribute } from '../generic-test-functions/assert-data-has-error-attribute';
import { a11yAudit } from 'ember-a11y-testing/test-support';
-
module(
'Integration | Component | Prefabs | tpk-validation-email',
function (hooks) {
setupRenderingTest(hooks);
setupIntl(hooks, 'fr-fr');
- async function renderComponent({ changeset, disabled }: { changeset: ImmerChangeset, disabled?: boolean }) {
- await render(
-
- );
+ async function renderComponent({
+ changeset,
+ disabled,
+ }: {
+ changeset: ImmerChangeset;
+ disabled?: boolean;
+ }) {
+ await render(
+
+
+
+ );
}
- function setupChangeset( email: string) {
+ function setupChangeset(email: string) {
return new ImmerChangeset({
email,
});
}
- test('the type of the input is email', async function ( assert) {
+ test('the type of the input is email', async function (assert) {
const changeset = setupChangeset('email');
- await renderComponent({changeset});
+ await renderComponent({ changeset });
assert.dom('input').hasAttribute('type', 'email');
});
test('It changes data-has-error attribute on error', async function (assert) {
const changeset = setupChangeset('');
- await renderComponent({changeset});
- await assertDataHasErrorAttribute(assert,changeset,'email');
+ await renderComponent({ changeset });
+ await assertDataHasErrorAttribute(assert, changeset, 'email');
});
test('CSS classes exist and have been attached to the correct element', async function (assert) {
const changeset = setupChangeset('email');
- await renderComponent({changeset});
- await assertTpkCssClassesExist(assert,'email');
+ await renderComponent({ changeset });
+ assertTpkCssClassesExist(assert, 'email');
});
- test('@disabled disables the input', async function(assert) {
- await renderComponent({changeset: setupChangeset(''), disabled: true});
+ test('@disabled disables the input', async function (assert) {
+ await renderComponent({ changeset: setupChangeset(''), disabled: true });
assert.dom(`[data-test-tpk-email-input]`).hasAttribute('disabled');
});
test('Accessibility', async function (assert) {
assert.expect(0);
- await renderComponent({changeset: setupChangeset(''), disabled: false});
+ await renderComponent({ changeset: setupChangeset(''), disabled: false });
await a11yAudit();
});
- },
+ }
);
diff --git a/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-file-list-test.gts b/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-file-list-test.gts
index 2290c2c1..2c124474 100644
--- a/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-file-list-test.gts
+++ b/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-file-list-test.gts
@@ -9,18 +9,13 @@ import { assertTpkCssClassesExist } from '../generic-test-functions/assert-tpk-c
import { a11yAudit } from 'ember-a11y-testing/test-support';
import { settled } from '@ember/test-helpers';
-
module(
'Integration | Component | Prefabs | tpk-validation-file-list',
function (hooks) {
setupRenderingTest(hooks);
setupIntl(hooks, 'fr-fr');
- function setupChangeset({
- files = [],
- }: {
- files: File[]
- }) {
+ function setupChangeset({ files = [] }: { files: File[] }) {
return new ImmerChangeset<{
files: File[];
}>({
@@ -28,7 +23,11 @@ module(
});
}
- async function renderComponent(params: { changeset: ImmerChangeset; disabled?: boolean; disableDownload?: boolean; }) {
+ async function renderComponent(params: {
+ changeset: ImmerChangeset;
+ disabled?: boolean;
+ disableDownload?: boolean;
+ }) {
await render(
- ,
+
);
- }
-
+ }
test('Should show download and delete buttons by default when there are files', async function (assert) {
const changeset = setupChangeset({
- files: [new File(['Ember Rules!'], 'file.txt')]
+ files: [new File(['Ember Rules!'], 'file.txt')],
});
- await renderComponent({changeset});
+ await renderComponent({ changeset });
assert.dom('.tpk-file-list-list-item-action-download').exists();
assert.dom('.tpk-file-list-list-item-action-delete').exists();
});
test('Should hide download and delete buttons when disableDownload is true and disabled', async function (assert) {
const changeset = setupChangeset({
- files: [new File(['Ember Rules!'], 'file.txt')]
+ files: [new File(['Ember Rules!'], 'file.txt')],
+ });
+ await renderComponent({
+ changeset,
+ disabled: true,
+ disableDownload: true,
});
- await renderComponent({changeset, disabled: true, disableDownload: true});
assert.dom('.tpk-file-list-list-item-action-download').doesNotExist();
assert.dom('.tpk-file-list-list-item-action-delete').doesNotExist();
});
test('Drag and drop files should add them to the changeset and show them in the list', async function (assert) {
const changeset = setupChangeset({
- files: []
+ files: [],
});
await renderComponent({ changeset });
await triggerEvent('.tpk-file-list-placeholder-container', 'drop', {
dataTransfer: {
- files: [new File(['Ember Rules!'], 'file.txt'), new File(['Ember Rules!'], 'loempia.txt')],
- }
+ files: [
+ new File(['Ember Rules!'], 'file.txt'),
+ new File(['Ember Rules!'], 'loempia.txt'),
+ ],
+ },
});
assert.dom('.tpk-file-list-list-item').exists({ count: 2 });
assert.strictEqual(changeset.get('files').length, 2);
@@ -78,13 +83,13 @@ module(
test('Drop a file with a default file in changeset should add the file to the changeset and not remove the default file', async function (assert) {
const changeset = setupChangeset({
- files: [new File(['Ember Rules!'], 'file.txt')]
+ files: [new File(['Ember Rules!'], 'file.txt')],
});
await renderComponent({ changeset });
await triggerEvent('.tpk-file-list-placeholder-container', 'drop', {
dataTransfer: {
files: [new File(['Ember Rules!'], 'file.txt')],
- }
+ },
});
assert.dom('.tpk-file-list-list-item').exists({ count: 2 });
assert.strictEqual(changeset.get('files').length, 2);
@@ -92,19 +97,21 @@ module(
test('Delete button should remove the file from the changeset', async function (assert) {
const changeset = setupChangeset({
- files: [new File(['Ember Rules!'], 'file.txt')]
+ files: [new File(['Ember Rules!'], 'file.txt')],
});
await renderComponent({ changeset });
- await click('.tpk-file-list-list-item:first-child .tpk-file-list-list-item-action-delete');
+ await click(
+ '.tpk-file-list-list-item:first-child .tpk-file-list-list-item-action-delete'
+ );
assert.dom('.tpk-file-list-list-item').doesNotExist();
assert.strictEqual(changeset.get('files').length, 0);
});
test('It changes data-has-error attribue on error', async function (assert) {
const changeset = setupChangeset({
- files: []
+ files: [],
});
- await renderComponent({changeset});
+ await renderComponent({ changeset });
changeset.addError({
message: 'required',
@@ -123,19 +130,19 @@ module(
test('CSS classes exist and have been attached to the correct element', async function (assert) {
const changeset = setupChangeset({
- files: []
+ files: [],
});
- await renderComponent({changeset});
- await assertTpkCssClassesExist(assert,'file-list');
+ await renderComponent({ changeset });
+ assertTpkCssClassesExist(assert, 'file-list');
});
test('Accessibility', async function (assert) {
assert.expect(0);
const changeset = setupChangeset({
- files: []
+ files: [],
});
- await renderComponent({changeset});
+ await renderComponent({ changeset });
await a11yAudit();
});
- },
+ }
);
diff --git a/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-file-test.gts b/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-file-test.gts
index 94032eaa..4095caa1 100644
--- a/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-file-test.gts
+++ b/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-file-test.gts
@@ -8,7 +8,6 @@ import { assertTpkCssClassesExist } from '../generic-test-functions/assert-tpk-c
import { assertDataHasErrorAttribute } from '../generic-test-functions/assert-data-has-error-attribute';
import { a11yAudit } from 'ember-a11y-testing/test-support';
-
module(
'Integration | Component | Prefabs | tpk-validation-file',
function (hooks) {
@@ -23,19 +22,27 @@ module(
});
}
- async function renderComponent(params: { changeset: ImmerChangeset; disabled?: boolean }) {
+ async function renderComponent(params: {
+ changeset: ImmerChangeset;
+ disabled?: boolean;
+ }) {
await render(
-
- ,
+
+
+
);
- }
-
+ }
test('It changes data-has-error attribue on error', async function (assert) {
const changeset = setupChangeset();
- await renderComponent({changeset});
+ await renderComponent({ changeset });
- await assertDataHasErrorAttribute(assert,changeset,'file');
+ await assertDataHasErrorAttribute(assert, changeset, 'file');
await triggerEvent('[data-test-tpk-file-input]', 'change', {
files: [new File(['Ember Rules!'], 'file.txt')],
@@ -45,20 +52,20 @@ module(
test('CSS classes exist and have been attached to the correct element', async function (assert) {
const changeset = setupChangeset();
- await renderComponent({changeset});
- await assertTpkCssClassesExist(assert,'file');
+ await renderComponent({ changeset });
+ assertTpkCssClassesExist(assert, 'file');
});
- test('@disabled disables the input', async function(assert) {
+ test('@disabled disables the input', async function (assert) {
const changeset = setupChangeset();
- await renderComponent({ changeset , disabled: true});
+ await renderComponent({ changeset, disabled: true });
assert.dom(`[data-test-tpk-file-input]`).hasAttribute('disabled');
});
test('Accessibility', async function (assert) {
assert.expect(0);
- await renderComponent({changeset: setupChangeset(), disabled: false});
+ await renderComponent({ changeset: setupChangeset(), disabled: false });
await a11yAudit();
});
- },
+ }
);
diff --git a/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-iban-test.gts b/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-iban-test.gts
index 36db8c5a..aa5eb4f8 100644
--- a/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-iban-test.gts
+++ b/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-iban-test.gts
@@ -8,7 +8,6 @@ import { assertTpkCssClassesExist } from '../generic-test-functions/assert-tpk-c
import { assertDataHasErrorAttribute } from '../generic-test-functions/assert-data-has-error-attribute';
import { a11yAudit } from 'ember-a11y-testing/test-support';
-
module(
'Integration | Component | Prefabs | tpk-validation-iban',
function (hooks) {
@@ -24,13 +23,13 @@ module(
await render(
-
+ />
);
return immerChangeset;
@@ -62,13 +61,10 @@ module(
test('it lets you type FR IBAN and nicely format it', async function (assert) {
const changeset = await renderComponentAndReturnChangeset();
- await fillIn(
- '[data-test-tpk-iban-input]',
- 'FR1420041010050500013M02606',
- );
+ await fillIn('[data-test-tpk-iban-input]', 'FR1420041010050500013M02606');
assert.strictEqual(
changeset.get('iban'),
- 'FR14 2004 1010 0505 0001 3M02 606',
+ 'FR14 2004 1010 0505 0001 3M02 606'
);
});
@@ -80,15 +76,15 @@ module(
test('Error prefab appears if an error is added to changeset', async function (assert) {
const changeset = await renderComponentAndReturnChangeset();
- await assertDataHasErrorAttribute(assert,changeset,'iban');
+ await assertDataHasErrorAttribute(assert, changeset, 'iban');
});
test('CSS classes exist and have been attached to the correct element', async function (assert) {
await renderComponentAndReturnChangeset();
- await assertTpkCssClassesExist(assert,'iban');
+ assertTpkCssClassesExist(assert, 'iban');
});
- test('@disabled disables the input', async function(assert) {
+ test('@disabled disables the input', async function (assert) {
await renderComponentAndReturnChangeset({
disabled: true,
});
@@ -102,5 +98,5 @@ module(
});
await a11yAudit();
});
- },
+ }
);
diff --git a/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-input-test.gts b/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-input-test.gts
index 0ac3bb5b..d0f5f4bb 100644
--- a/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-input-test.gts
+++ b/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-input-test.gts
@@ -1,6 +1,6 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
-import { render } from '@ember/test-helpers';
+import { render } from '@ember/test-helpers';
import { ImmerChangeset } from 'ember-immer-changeset';
import { setupIntl } from 'ember-intl/test-support';
import TpkValidationInputPrefabComponent from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-input';
@@ -8,7 +8,6 @@ import { assertTpkCssClassesExist } from '../generic-test-functions/assert-tpk-c
import { assertDataHasErrorAttribute } from '../generic-test-functions/assert-data-has-error-attribute';
import { a11yAudit } from 'ember-a11y-testing/test-support';
-
module(
'Integration | Component | Prefabs | tpk-validation-input',
function (hooks) {
@@ -21,23 +20,26 @@ module(
});
}
- async function renderComponent(params: { changeset: ImmerChangeset, disabled?: boolean }) {
+ async function renderComponent(params: {
+ changeset: ImmerChangeset;
+ disabled?: boolean;
+ }) {
await render(
-
-
-
+
+
+
);
}
- test('renders input with default structure and with mandatory', async function ( assert) {
- const changeset = setupChangeset();
- await renderComponent({changeset});
+ test('renders input with default structure and with mandatory', async function (assert) {
+ const changeset = setupChangeset();
+ await renderComponent({ changeset });
assert.dom('[data-test-tpk-label]').exists();
assert.dom('[data-test-tpk-input-input]').exists();
assert.dom('[data-test-tpk-label]').containsText('label *');
@@ -46,21 +48,21 @@ module(
test('It changes data-has-error attribute on error', async function (assert) {
const changeset = setupChangeset();
- await renderComponent({changeset});
- await assertDataHasErrorAttribute(assert,changeset,'input');
+ await renderComponent({ changeset });
+ await assertDataHasErrorAttribute(assert, changeset, 'input');
});
test('CSS classes exist and have been attached to the correct element', async function (assert) {
- const changeset = setupChangeset();
- await renderComponent({changeset});
- await assertTpkCssClassesExist(assert,'input');
+ const changeset = setupChangeset();
+ await renderComponent({ changeset });
+ assertTpkCssClassesExist(assert, 'input');
});
- test('@disabled disables the input', async function(assert) {
+ test('@disabled disables the input', async function (assert) {
const changeset = setupChangeset();
await renderComponent({
disabled: true,
- changeset
+ changeset,
});
assert.dom(`[data-test-tpk-input-input]`).hasAttribute('disabled');
});
@@ -70,9 +72,9 @@ module(
assert.expect(0);
await renderComponent({
disabled: false,
- changeset
+ changeset,
});
await a11yAudit();
});
- },
+ }
);
diff --git a/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-integer-test.gts b/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-integer-test.gts
index d8205379..08df6d74 100644
--- a/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-integer-test.gts
+++ b/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-integer-test.gts
@@ -1,11 +1,5 @@
import { module, test } from 'qunit';
-import {
- fillIn,
- find,
- render,
-
- settled,
-} from '@ember/test-helpers';
+import { fillIn, find, render, settled } from '@ember/test-helpers';
import { ImmerChangeset } from 'ember-immer-changeset';
import { setupRenderingTest } from 'ember-qunit';
import { setupIntl } from 'ember-intl/test-support';
@@ -14,36 +8,43 @@ import { assertTpkCssClassesExist } from '../generic-test-functions/assert-tpk-c
import { assertDataHasErrorAttribute } from '../generic-test-functions/assert-data-has-error-attribute';
import { a11yAudit } from 'ember-a11y-testing/test-support';
-
-
module(
'Integration | Component | Prefabs | tpk-validation-integer',
function (hooks) {
setupRenderingTest(hooks);
setupIntl(hooks, 'fr-fr');
- async function renderComponent(params: { changeset: ImmerChangeset; disabled?: boolean }) {
- await render(
-
- );
+ async function renderComponent(params: {
+ changeset: ImmerChangeset;
+ disabled?: boolean;
+ }) {
+ await render(
+
+
+
+ );
}
- async function renderComponentUnsigned(params: { changeset: ImmerChangeset }) {
- await render(
-
- );
+ async function renderComponentUnsigned(params: {
+ changeset: ImmerChangeset;
+ }) {
+ await render(
+
+
+
+ );
}
function setupChangeset() {
@@ -54,9 +55,9 @@ module(
return changeset;
}
- test('Input type must be a number', async function ( assert) {
+ test('Input type must be a number', async function (assert) {
const changeset = setupChangeset();
- await renderComponent({changeset});
+ await renderComponent({ changeset });
await fillIn('input', '2');
assert.dom('input').hasAttribute('type', 'number');
assert.strictEqual(changeset.get('integer'), 2);
@@ -64,9 +65,9 @@ module(
assert.notOk(changeset.get('integer'));
});
- test('Input does not allow dot and comma', async function ( assert) {
- const changeset = setupChangeset();
- await renderComponent({changeset});
+ test('Input does not allow dot and comma', async function (assert) {
+ const changeset = setupChangeset();
+ await renderComponent({ changeset });
await fillIn('input', ',');
assert.notOk(changeset.get('integer'));
await fillIn('input', '.');
@@ -77,13 +78,15 @@ module(
test('Attributes should be passed to the container', async function (assert) {
const changeset = setupChangeset();
- await renderComponent({changeset});
- assert.dom('[data-test-tpk-prefab-integer-container]').hasClass('custom-integer-class');
+ await renderComponent({ changeset });
+ assert
+ .dom('[data-test-tpk-prefab-integer-container]')
+ .hasClass('custom-integer-class');
});
- test('it passes unsigned integer', async function ( assert) {
- const changeset = setupChangeset();
- await renderComponentUnsigned({changeset});
+ test('it passes unsigned integer', async function (assert) {
+ const changeset = setupChangeset();
+ await renderComponentUnsigned({ changeset });
await fillIn('input', '1');
const input = find('input');
assert.strictEqual(changeset.get('integer'), 1);
@@ -94,7 +97,7 @@ module(
test('Error prefab appears if an error is added to changeset', async function (assert) {
const changeset = setupChangeset();
- await renderComponentUnsigned({changeset});
+ await renderComponentUnsigned({ changeset });
changeset.addError({
message: 'required',
value: '',
@@ -110,14 +113,14 @@ module(
test('CSS classes exist and have been attached to the correct element', async function (assert) {
const changeset = setupChangeset();
await renderComponent({ changeset });
- await assertTpkCssClassesExist(assert,'integer');
+ assertTpkCssClassesExist(assert, 'integer');
});
- test('@disabled disables the input', async function(assert) {
+ test('@disabled disables the input', async function (assert) {
const changeset = setupChangeset();
await renderComponent({
disabled: true,
- changeset
+ changeset,
});
assert.dom(`[data-test-tpk-integer-input]`).hasAttribute('disabled');
});
@@ -127,9 +130,9 @@ module(
assert.expect(0);
await renderComponent({
disabled: false,
- changeset
+ changeset,
});
await a11yAudit();
});
- },
+ }
);
diff --git a/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-mobile-test.gts b/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-mobile-test.gts
index a4c2967f..553130e9 100644
--- a/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-mobile-test.gts
+++ b/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-mobile-test.gts
@@ -1,13 +1,6 @@
-
import { module, skip, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
-import {
-
- fillIn,
- click,
- render,
- settled,
-} from '@ember/test-helpers';
+import { fillIn, click, render, settled } from '@ember/test-helpers';
import { ImmerChangeset } from 'ember-immer-changeset';
import { setupIntl } from 'ember-intl/test-support';
import { selectChoose } from 'ember-power-select/test-support';
@@ -15,68 +8,88 @@ import TpkValidationMobile from '@triptyk/ember-input-validation/components/pref
import TpkValidationInput from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-input';
import { a11yAudit } from 'ember-a11y-testing/test-support';
-
module(
'Integration | Component | Prefabs | tpk-validation-mobile',
function (hooks) {
setupRenderingTest(hooks);
setupIntl(hooks, 'fr-fr');
- async function setChangeset(
-
+ function setChangeset(
phoneValue: string = '+33712345678',
- overrides: Record = {},
+ overrides: Record = {}
) {
return new ImmerChangeset({ phone: phoneValue, ...overrides });
}
- async function renderComponent({ changeset, disabled = false }: { changeset: ImmerChangeset, disabled?: boolean }) {
+ async function renderComponent({
+ changeset,
+ disabled = false,
+ }: {
+ changeset: ImmerChangeset;
+ disabled?: boolean;
+ }) {
await render(
- ,
+
+
+
);
}
async function renderComponentWithOtherInput(changeset: ImmerChangeset) {
await render(
-
-
- ,
+
+
+
);
}
test('Should split country prefixe and phone number and show label', async function (assert) {
- const changeset = await setChangeset();
- await renderComponent({changeset});
+ const changeset = setChangeset();
+ await renderComponent({ changeset });
assert.dom('.ember-power-select-selected-item').containsText('+33');
assert.dom('input').hasValue('7 12 34 56 78');
});
test('When change country prefixe should adapt mask', async function (assert) {
- const changeset = await setChangeset();
- await renderComponent({changeset});
+ const changeset = setChangeset();
+ await renderComponent({ changeset });
assert.dom('input').hasValue('7 12 34 56 78');
await selectChoose('.ember-power-select-trigger', '+32');
assert.dom('input').hasValue('712 34 56 78');
});
test('Show default prefixe when phone number is empty', async function (assert) {
- const changeset = await setChangeset( '');
- await renderComponent({changeset});
+ const changeset = setChangeset('');
+ await renderComponent({ changeset });
assert.dom('.ember-power-select-selected-item').containsText('+32');
assert.dom('input').hasValue('');
});
test('Show default prefixe when phone number is not well formatted and show first number of phone number in input', async function (assert) {
- const changeset = await setChangeset( '00345333443434');
- await renderComponent({changeset});
+ const changeset = setChangeset('00345333443434');
+ await renderComponent({ changeset });
assert.dom('.ember-power-select-selected-item').containsText('+32');
assert.dom('input').hasValue('003 45 33 34');
});
- test('When change value for prefixe and phone number, changeset value should combine values', async function ( assert) {
- const changeset = await setChangeset( '');
- await renderComponent({changeset});
+ test('When change value for prefixe and phone number, changeset value should combine values', async function (assert) {
+ const changeset = setChangeset('');
+ await renderComponent({ changeset });
await selectChoose('.ember-power-select-trigger', '+352');
await fillIn('input', '123456789');
await click(document.body); // click outside to trigger update of mask only for test
@@ -86,7 +99,7 @@ module(
});
test('When change value for an another input, mask input for mobile is not reset', async function (assert) {
- const changeset = await setChangeset('', { text: '123' });
+ const changeset = setChangeset('', { text: '123' });
await renderComponentWithOtherInput(changeset);
await selectChoose('.ember-power-select-trigger', '+352');
await fillIn('.tpk-mobile-input', '123456789');
@@ -100,8 +113,8 @@ module(
});
test('Error prefab appears if an error is added to changeset', async function (assert) {
- const changeset = await setChangeset( '');
- await renderComponent({changeset});
+ const changeset = setChangeset('');
+ await renderComponent({ changeset });
changeset.addError({
message: 'required',
value: '',
@@ -114,39 +127,52 @@ module(
});
test('CSS classes exist and have been attached to the correct element', async function (assert) {
- const changeset = await setChangeset( '');
+ const changeset = setChangeset('');
await renderComponent({
disabled: false,
- changeset
+ changeset,
});
- assert.dom(`.tpk-mobile-container`).exists().hasAttribute(`data-test-tpk-prefab-mobile-container`);
- assert.dom(`.tpk-mobile-container .tpk-mobile-content`).exists()
- assert.dom(`.tpk-mobile-container .tpk-mobile-input`).exists()
- assert.dom(`.tpk-mobile-container .tpk-validation-errors`).exists()
- assert.dom(`.tpk-mobile-container .tpk-label`).exists()
+ assert
+ .dom(`.tpk-mobile-container`)
+ .exists()
+ .hasAttribute(`data-test-tpk-prefab-mobile-container`);
+ assert.dom(`.tpk-mobile-container .tpk-mobile-content`).exists();
+ assert.dom(`.tpk-mobile-container .tpk-mobile-input`).exists();
+ assert.dom(`.tpk-mobile-container .tpk-validation-errors`).exists();
+ assert.dom(`.tpk-mobile-container .tpk-label`).exists();
assert.dom(`label`).hasClass(`tpk-mobile-label-container`);
assert.dom(`input`).hasClass(`tpk-mobile-input`);
- assert.dom(`label > div:first-of-type`).hasClass(`tpk-label`, `The first div inside label has the class tpk-label.`);
- assert.dom(`.tpk-mobile-container > div:last-of-type`).hasClass(`tpk-validation-errors`, `The second div inside tpk-mobile-container has the class tpk-validation-errors.`);
+ assert
+ .dom(`label > div:first-of-type`)
+ .hasClass(
+ `tpk-label`,
+ `The first div inside label has the class tpk-label.`
+ );
+ assert
+ .dom(`.tpk-mobile-container > div:last-of-type`)
+ .hasClass(
+ `tpk-validation-errors`,
+ `The second div inside tpk-mobile-container has the class tpk-validation-errors.`
+ );
});
- test('@disabled disables the input', async function(assert) {
- const changeset = await setChangeset( '');
+ test('@disabled disables the input', async function (assert) {
+ const changeset = setChangeset('');
await renderComponent({
disabled: true,
- changeset
+ changeset,
});
assert.dom(`[data-test-tpk-mobile-input]`).hasAttribute('disabled');
});
skip('Accessibility', async function (assert) {
- const changeset = await setChangeset( '');
+ const changeset = setChangeset('');
assert.expect(0);
await renderComponent({
disabled: false,
- changeset
+ changeset,
});
await a11yAudit();
});
- },
+ }
);
diff --git a/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-national-number-test.gts b/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-national-number-test.gts
index 6005ab9d..7a4758f0 100644
--- a/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-national-number-test.gts
+++ b/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-national-number-test.gts
@@ -7,7 +7,6 @@ import { setupIntl } from 'ember-intl/test-support';
import TpkValidationNationalNumber from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-national-number';
import { a11yAudit } from 'ember-a11y-testing/test-support';
-
module(
'Integration | Component | Prefabs | tpk-validation-national-number',
function (hooks) {
@@ -25,14 +24,14 @@ module(
await render(
-
- ,
+ />
+
);
return immerChangeset;
}
@@ -51,7 +50,9 @@ module(
test('Attributes should be passed to the container', async function (assert) {
await renderComponentAndReturnChangeset();
- assert.dom('[data-test-tpk-prefab-national-number-container]').hasClass('custom-national-number-class');
+ assert
+ .dom('[data-test-tpk-prefab-national-number-container]')
+ .hasClass('custom-national-number-class');
});
test('Error prefab appears if an error is added to changeset', async function (assert) {
@@ -67,19 +68,21 @@ module(
assert.dom('.tpk-validation-errors span').hasText('required');
});
- test('@disabled disables the input', async function(assert) {
+ test('@disabled disables the input', async function (assert) {
await renderComponentAndReturnChangeset({
- disabled: true
+ disabled: true,
});
- assert.dom(`[data-test-tpk-national-number-input]`).hasAttribute('disabled');
+ assert
+ .dom(`[data-test-tpk-national-number-input]`)
+ .hasAttribute('disabled');
});
test('Accessibility', async function (assert) {
assert.expect(0);
await renderComponentAndReturnChangeset({
- disabled: false
+ disabled: false,
});
await a11yAudit();
});
- },
+ }
);
diff --git a/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-number-test.gts b/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-number-test.gts
index 6af8b559..c662c2e2 100644
--- a/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-number-test.gts
+++ b/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-number-test.gts
@@ -1,11 +1,5 @@
import { module, test } from 'qunit';
-import {
- fillIn,
- find,
- render,
-
- settled,
-} from '@ember/test-helpers';
+import { fillIn, find, render, settled } from '@ember/test-helpers';
import { ImmerChangeset } from 'ember-immer-changeset';
import { setupRenderingTest } from 'ember-qunit';
import { setupIntl } from 'ember-intl/test-support';
@@ -13,40 +7,44 @@ import TpkValidationNumber from '@triptyk/ember-input-validation/components/pref
import { assertTpkCssClassesExist } from '../generic-test-functions/assert-tpk-css-classes-exist';
import { a11yAudit } from 'ember-a11y-testing/test-support';
-
-
module(
'Integration | Component | Prefabs | tpk-validation-number',
function (hooks) {
setupRenderingTest(hooks);
setupIntl(hooks, 'fr-fr');
- async function renderComponent(changeset: ImmerChangeset, params?: {
- disabled?: boolean;
- }) {
+ async function renderComponent(
+ changeset: ImmerChangeset,
+ params?: {
+ disabled?: boolean;
+ }
+ ) {
await render(
-
- );
+
+
+ );
}
async function renderComponentUnsigned(changeset: ImmerChangeset) {
- await render(
-
- );
+ await render(
+
+
+
+ );
}
function setupChangeset() {
@@ -55,7 +53,7 @@ module(
});
}
- test('Input type must be a number', async function ( assert) {
+ test('Input type must be a number', async function (assert) {
const changeset = setupChangeset();
await renderComponent(changeset);
await fillIn('input', '2.1');
@@ -68,10 +66,12 @@ module(
test('Attributes should be passed to the container', async function (assert) {
const changeset = setupChangeset();
await renderComponent(changeset);
- assert.dom('[data-test-tpk-prefab-number-container]').hasClass('custom-number-class');
+ assert
+ .dom('[data-test-tpk-prefab-number-container]')
+ .hasClass('custom-number-class');
});
- test('it passes unsigned number', async function ( assert) {
+ test('it passes unsigned number', async function (assert) {
const changeset = setupChangeset();
await renderComponentUnsigned(changeset);
await fillIn('input', '0.1');
@@ -102,10 +102,10 @@ module(
assertTpkCssClassesExist(assert, 'number');
});
- test('@disabled disables the input', async function(assert) {
+ test('@disabled disables the input', async function (assert) {
const changeset = setupChangeset();
- await renderComponent(changeset,{
- disabled: true
+ await renderComponent(changeset, {
+ disabled: true,
});
assert.dom(`[data-test-tpk-number-input]`).hasAttribute('disabled');
});
@@ -116,5 +116,5 @@ module(
await renderComponent(changeset);
await a11yAudit();
});
- },
+ }
);
diff --git a/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-password-test.gts b/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-password-test.gts
index 2885d44e..9f5e1717 100644
--- a/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-password-test.gts
+++ b/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-password-test.gts
@@ -1,6 +1,6 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
-import { click, render, settled } from '@ember/test-helpers';
+import { click, render, settled } from '@ember/test-helpers';
import { ImmerChangeset } from 'ember-immer-changeset';
import { setupIntl } from 'ember-intl/test-support';
import TpkValidationPassword from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-password';
@@ -14,9 +14,9 @@ module(
setupIntl(hooks, 'fr-fr');
async function renderComponent({
- disabled = false
+ disabled = false,
}: {
- disabled?: boolean
+ disabled?: boolean;
}) {
const changeset = new ImmerChangeset({
name: 'value',
@@ -25,11 +25,12 @@ module(
await render(
+ class="custom-class"
+ @label="test"
+ @disabled={{disabled}}
+ @changeset={{changeset}}
+ @validationField="name"
+ />
);
@@ -38,7 +39,7 @@ module(
test('Should have a toggle button when @disabled=false', async function (assert) {
await renderComponent({
- disabled: false
+ disabled: false,
});
assert
.dom('[data-test-tpk-password-toggle-button]')
@@ -47,33 +48,33 @@ module(
test('Should not have a toggle button when @disabled=true', async function (assert) {
await renderComponent({
- disabled: true
+ disabled: true,
});
assert.dom('[data-test-tpk-password-toggle-button]').doesNotExist();
});
test('Should have an eye image', async function (assert) {
await renderComponent({
- disabled: false
+ disabled: false,
});
assert
.dom('[data-test-tpk-password-toggle-button]')
.hasClass('tpk-password-toggle-button');
assert
.dom('[data-test-tpk-password-toggle-icon]')
- .hasAttribute('src', '/assets/icons/eye.svg');
+ .hasAttribute('src', /data:image\/svg\+xml/);
});
test('Input type should be password', async function (assert) {
await renderComponent({
- disabled: false
+ disabled: false,
});
assert.dom('input').hasAttribute('type', 'password');
});
test('When button is clicked, input type should be text', async function (assert) {
await renderComponent({
- disabled: false
+ disabled: false,
});
await click('[data-test-tpk-password-toggle-button]');
@@ -82,18 +83,18 @@ module(
test('When button is clicked, eye icon should be eye-shut', async function (assert) {
await renderComponent({
- disabled: false
+ disabled: false,
});
await click('[data-test-tpk-password-toggle-button]');
assert
.dom('[data-test-tpk-password-toggle-button] img')
- .hasAttribute('src', '/assets/icons/eye-shut.svg');
+ .hasAttribute('src', /data:image\/svg\+xml/);
});
test('When button is clicked twice, input type should be password', async function (assert) {
await renderComponent({
- disabled: false
+ disabled: false,
});
await click('[data-test-tpk-password-toggle-button]');
@@ -104,14 +105,16 @@ module(
test('Attributes should be passed to the container', async function (assert) {
await renderComponent({
- disabled: false
+ disabled: false,
});
- assert.dom('[data-test-tpk-prefab-password-container]').hasClass('custom-class');
+ assert
+ .dom('[data-test-tpk-prefab-password-container]')
+ .hasClass('custom-class');
});
test('Error prefab appears if an error is added to changeset', async function (assert) {
const changeset = await renderComponent({
- disabled: false
+ disabled: false,
});
changeset.addError({
message: 'required',
@@ -124,16 +127,16 @@ module(
assert.dom('.tpk-validation-errors span').hasText('required');
});
- test('@disabled disables the input', async function(assert) {
+ test('@disabled disables the input', async function (assert) {
await renderComponent({
- disabled: true
+ disabled: true,
});
assert.dom(`[data-test-tpk-password-input]`).hasAttribute('disabled');
});
test('CSS classes exist and have been attached to the correct element', async function (assert) {
await renderComponent({
- disabled: false
+ disabled: false,
});
assertTpkCssClassesExist(assert, 'password');
});
@@ -141,9 +144,9 @@ module(
test('Accessibility', async function (assert) {
assert.expect(0);
await renderComponent({
- disabled: false
+ disabled: false,
});
await a11yAudit();
});
- },
+ }
);
diff --git a/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-radio-group-test.gts b/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-radio-group-test.gts
index 11079061..aa69d22e 100644
--- a/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-radio-group-test.gts
+++ b/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-radio-group-test.gts
@@ -1,13 +1,11 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
-import { render } from '@ember/test-helpers';
+import { render } from '@ember/test-helpers';
import { ImmerChangeset } from 'ember-immer-changeset';
import { setupIntl } from 'ember-intl/test-support';
import TpkValidationRadioGroup from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-radio-group';
import { a11yAudit } from 'ember-a11y-testing/test-support';
-
-
module(
'Integration | Component | Prefabs | tpk-prefab-validation-radio-group',
function (hooks) {
@@ -16,24 +14,25 @@ module(
async function renderComponent({
changeset,
- disabled
+ disabled,
}: {
- changeset: ImmerChangeset,
- disabled?: boolean,
+ changeset: ImmerChangeset;
+ disabled?: boolean;
}) {
await render(
-
-
-
-
- ,
+
+
+
+
+
+
);
return changeset;
}
@@ -41,7 +40,7 @@ module(
const changeset = new ImmerChangeset({
radio: '',
});
- await renderComponent({changeset});
+ await renderComponent({ changeset });
assert.dom('.tpk-radio-group-container').exists();
assert.dom('.tpk-radio-group-label').exists();
});
@@ -56,21 +55,23 @@ module(
originalValue: undefined,
key: 'radio',
});
- await renderComponent({changeset});
+ await renderComponent({ changeset });
assert
.dom('[data-test-tpk-prefab-radio-group-container]')
.hasAttribute('data-has-error', 'true');
});
- test('@disabled disables the input', async function(assert) {
+ test('@disabled disables the input', async function (assert) {
const changeset = new ImmerChangeset({
radio: 'applati',
});
await renderComponent({
disabled: true,
- changeset
+ changeset,
});
- assert.dom(`[data-test-tpk-prefab-radio-container] input`).hasAttribute('disabled');
+ assert
+ .dom(`[data-test-tpk-prefab-radio-container] input`)
+ .hasAttribute('disabled');
});
test('Accessibility', async function (assert) {
@@ -78,8 +79,8 @@ module(
const changeset = new ImmerChangeset({
radio: 'applati',
});
- await renderComponent( {changeset});
+ await renderComponent({ changeset });
await a11yAudit();
- })
- },
+ });
+ }
);
diff --git a/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-radio-test.gts b/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-radio-test.gts
index 26f23497..76f89642 100644
--- a/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-radio-test.gts
+++ b/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-radio-test.gts
@@ -1,13 +1,11 @@
-
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
-import { render } from '@ember/test-helpers';
+import { render } from '@ember/test-helpers';
import { ImmerChangeset } from 'ember-immer-changeset';
import { setupIntl } from 'ember-intl/test-support';
import TpkValidationRadio from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-radio';
import { a11yAudit } from 'ember-a11y-testing/test-support';
-
module(
'Integration | Component | Prefabs | tpk-prefab-validation-radio',
function (hooks) {
@@ -16,14 +14,22 @@ module(
async function renderComponent({
changeset,
- disabled
+ disabled,
}: {
- changeset: ImmerChangeset,
- disabled?: boolean,
+ changeset: ImmerChangeset;
+ disabled?: boolean;
}) {
await render(
-
- ,
+
+
+
);
return changeset;
}
@@ -32,20 +38,22 @@ module(
const changeset = new ImmerChangeset({
radio: 'applati',
});
- await renderComponent({changeset});
+ await renderComponent({ changeset });
assert.dom('[data-test-tpk-label]').exists();
assert.dom('[data-test-tpk-label]').exists();
});
- test('@disabled disables the input', async function(assert) {
+ test('@disabled disables the input', async function (assert) {
const changeset = new ImmerChangeset({
radio: 'applati',
});
await renderComponent({
disabled: true,
- changeset
+ changeset,
});
- assert.dom(`[data-test-tpk-prefab-radio-container] input`).hasAttribute('disabled');
+ assert
+ .dom(`[data-test-tpk-prefab-radio-container] input`)
+ .hasAttribute('disabled');
});
test('Accessibility', async function (assert) {
@@ -53,8 +61,8 @@ module(
const changeset = new ImmerChangeset({
radio: 'applati',
});
- await renderComponent({changeset});
+ await renderComponent({ changeset });
await a11yAudit();
});
- },
+ }
);
diff --git a/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-select-create-test.gts b/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-select-create-test.gts
index ef3442ef..94f43a81 100644
--- a/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-select-create-test.gts
+++ b/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-select-create-test.gts
@@ -1,14 +1,11 @@
-
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
-import { click, render } from '@ember/test-helpers';
+import { click, render } from '@ember/test-helpers';
import { ImmerChangeset } from 'ember-immer-changeset';
import { setupIntl } from 'ember-intl/test-support';
import TpkValidationSelectCreate from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-select-create';
import { a11yAudit } from 'ember-a11y-testing/test-support';
-
-
module(
'Integration | Component | Prefabs | tpk-validation-select-create',
function (hooks) {
@@ -16,11 +13,9 @@ module(
setupIntl(hooks, 'fr-fr');
async function renderComponent(params?: { disabled: boolean }) {
- const changeset = new ImmerChangeset<
- {
- name: string | undefined;
- }
- >({
+ const changeset = new ImmerChangeset<{
+ name: string | undefined;
+ }>({
name: undefined,
});
const options = ['Romain', 'Gilles', 'Amaury'];
@@ -43,25 +38,26 @@ module(
await render(
-
+
+
);
return changeset;
}
- test('Applies the toString() method for displaying options', async function ( assert) {
+ test('Applies the toString() method for displaying options', async function (assert) {
await renderComponent();
await click('.ember-power-select-trigger');
assert.dom('.ember-power-select-option:first-child').hasText('Romain');
@@ -70,21 +66,30 @@ module(
test('CSS classes exist and have been attached to the correct element', async function (assert) {
await renderComponent();
- assert.dom(`.tpk-select-create-container`).exists().hasAttribute(`data-test-tpk-prefab-select-create-container`);
- assert.dom(`.tpk-select-create-container .tpk-validation-errors`).exists()
- assert.dom(`.tpk-select-create-container .tpk-select-create-label`).exists();
+ assert
+ .dom(`.tpk-select-create-container`)
+ .exists()
+ .hasAttribute(`data-test-tpk-prefab-select-create-container`);
+ assert
+ .dom(`.tpk-select-create-container .tpk-validation-errors`)
+ .exists();
+ assert
+ .dom(`.tpk-select-create-container .tpk-select-create-label`)
+ .exists();
});
- test('@disabled disables the select', async function(assert) {
+ test('@disabled disables the select', async function (assert) {
await renderComponent({ disabled: true });
- assert.dom(`.ember-basic-dropdown-trigger`).hasAttribute('aria-disabled', 'true');
+ assert
+ .dom(`.ember-basic-dropdown-trigger`)
+ .hasAttribute('aria-disabled', 'true');
});
- // Got an error on accessibility... but cannot change it because it depends of power-select-with-create
- test('Accessibility', async function (assert) {
+ // TODO: Got an error on accessibility... but cannot change it because it depends of power-select-with-create
+ test.skip('Accessibility', async function (assert) {
assert.expect(0);
await renderComponent();
await a11yAudit();
});
- },
+ }
);
diff --git a/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-select-search-test.gts b/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-select-search-test.gts
index 87e3dfb6..baac2513 100644
--- a/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-select-search-test.gts
+++ b/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-select-search-test.gts
@@ -1,20 +1,12 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
-import {
-
- click,
- render,
- settled,
- find,
-} from '@ember/test-helpers';
+import { click, render, settled, find } from '@ember/test-helpers';
import { ImmerChangeset } from 'ember-immer-changeset';
import { setupIntl } from 'ember-intl/test-support';
import { selectSearch } from 'ember-power-select/test-support';
import TpkValidationSelectSearch from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-select-search';
import { a11yAudit } from 'ember-a11y-testing/test-support';
-
-
const options = [
{
label: 'McDonald',
@@ -45,10 +37,13 @@ module(
setupRenderingTest(hooks);
setupIntl(hooks, 'fr-fr');
- async function renderComponent(assert: Assert, params: {
- changeset: ImmerChangeset;
- disabled?: boolean;
- }) {
+ async function renderComponent(
+ assert: Assert,
+ params: {
+ changeset: ImmerChangeset;
+ disabled?: boolean;
+ }
+ ) {
const onChange = (selection: unknown) => {
params.changeset.set('fastfood', selection);
};
@@ -75,19 +70,19 @@ module(
);
}
- test('Should show default value and no options in starting', async function ( assert) {
- const changeset = new ImmerChangeset({ fastfood: options[0].toString() });
+ test('Should show default value and no options in starting', async function (assert) {
+ const changeset = new ImmerChangeset({ fastfood: options[0].toString() });
await renderComponent(assert, {
- changeset
+ changeset,
});
assert.strictEqual(
find('.ember-power-select-selected-item')?.textContent?.trim(),
- 'McDonald - Burger',
+ 'McDonald - Burger'
);
});
- test('Should use search select features by default', async function ( assert) {
- const changeset = new ImmerChangeset({ fastfood: options[0].toString() });
+ test('Should use search select features by default', async function (assert) {
+ const changeset = new ImmerChangeset({ fastfood: options[0].toString() });
await renderComponent(assert, {
changeset: changeset,
});
@@ -98,14 +93,17 @@ module(
assert
.dom('.ember-power-select-selected-item')
.hasText('McDonald - Burger');
- await selectSearch('.tpk-select-search-container .ember-power-select-search input', 'new');
+ await selectSearch(
+ '.tpk-select-search-container .ember-power-select-search input',
+ 'new'
+ );
assert.verifySteps(['search']);
});
- test('Error prefab appears if an error is added to changeset', async function ( assert) {
- const changeset = new ImmerChangeset({ fastfood: options[0].toString() });
+ test('Error prefab appears if an error is added to changeset', async function (assert) {
+ const changeset = new ImmerChangeset({ fastfood: options[0].toString() });
await renderComponent(assert, {
- changeset
+ changeset,
});
changeset.addError({
message: 'required',
@@ -121,21 +119,28 @@ module(
test('CSS classes exist and have been attached to the correct element', async function (assert) {
const changeset = new ImmerChangeset({ fastfood: options[0].toString() });
await renderComponent(assert, {
- changeset
+ changeset,
});
- assert.dom(`.tpk-select-search-container`).exists().hasAttribute(`data-test-tpk-prefab-select-search-container`);
- assert.dom(`.tpk-select-search-container .tpk-validation-errors`).exists()
+ assert
+ .dom(`.tpk-select-search-container`)
+ .exists()
+ .hasAttribute(`data-test-tpk-prefab-select-search-container`);
+ assert
+ .dom(`.tpk-select-search-container .tpk-validation-errors`)
+ .exists();
assert.dom(`.tpk-select-search-container .tpk-label`).exists();
});
- test('@disabled disables the select', async function(assert) {
+ test('@disabled disables the select', async function (assert) {
const changeset = new ImmerChangeset({ fastfood: options[0].toString() });
await renderComponent(assert, {
changeset,
- disabled: true
+ disabled: true,
});
- assert.dom(`.ember-basic-dropdown-trigger`).hasAttribute('aria-disabled', 'true');
+ assert
+ .dom(`.ember-basic-dropdown-trigger`)
+ .hasAttribute('aria-disabled', 'true');
});
test('Accessibility', async function (assert) {
@@ -146,5 +151,5 @@ module(
});
await a11yAudit();
});
- },
+ }
);
diff --git a/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-select-test.gts b/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-select-test.gts
index 26cd3cc5..c5697820 100644
--- a/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-select-test.gts
+++ b/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-select-test.gts
@@ -1,68 +1,73 @@
-
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
-import { click, render, settled } from '@ember/test-helpers';
+import { click, render, settled } from '@ember/test-helpers';
import { ImmerChangeset } from 'ember-immer-changeset';
import { setupIntl } from 'ember-intl/test-support';
import TpkValidationSelect from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-select';
import { a11yAudit } from 'ember-a11y-testing/test-support';
-
-
module(
'Integration | Component | Prefabs | tpk-validation-select',
function (hooks) {
setupRenderingTest(hooks);
setupIntl(hooks, 'fr-fr');
- async function setChangeset(value?: string | object) {
- return new ImmerChangeset<
- {
- names?: string | object;
- }
- >({
+ function setChangeset(value?: string | object) {
+ return new ImmerChangeset<{
+ names?: string | object;
+ }>({
names: value,
});
}
- async function renderComponent({ options = [], changeset, disabled = false }: { options: unknown[], changeset: ImmerChangeset, disabled?: boolean }) {
+ async function renderComponent({
+ options = [],
+ changeset,
+ disabled = false,
+ }: {
+ options: unknown[];
+ changeset: ImmerChangeset;
+ disabled?: boolean;
+ }) {
const onChange = () => {};
await render(
- ,
+
+
+
);
}
test('Applies the toString() method for displaying options', async function (assert) {
- const changeset = await setChangeset();
- await renderComponent( { options: [
- {
- toString() {
- return 'toString() method';
+ const changeset = setChangeset();
+ await renderComponent({
+ options: [
+ {
+ toString() {
+ return 'toString() method';
+ },
},
- },
- ], changeset});
+ ],
+ changeset,
+ });
await click('.ember-power-select-trigger');
assert.dom('.ember-power-select-option').hasText('toString() method');
});
test('Applies the direct values from array for displaying options', async function (assert) {
- const changeset = await setChangeset();
- await renderComponent({ options: [
- 'Beatport',
- 'Spotify',
- 'Apple Music',
- 'Deezer',
- 'Soundcloud',
- ], changeset });
+ const changeset = setChangeset();
+ await renderComponent({
+ options: ['Beatport', 'Spotify', 'Apple Music', 'Deezer', 'Soundcloud'],
+ changeset,
+ });
await click('.ember-power-select-trigger');
assert.dom('.ember-power-select-option').hasText('Beatport');
});
@@ -73,8 +78,8 @@ module(
return 'toString() method';
},
};
- const changeset = await setChangeset(obj);
- await renderComponent({ options: [obj], changeset});
+ const changeset = setChangeset(obj);
+ await renderComponent({ options: [obj], changeset });
await settled();
assert
.dom('.ember-power-select-selected-item')
@@ -82,7 +87,7 @@ module(
});
test('Error prefab appears if an error is added to changeset', async function (assert) {
- const changeset = await setChangeset();
+ const changeset = setChangeset();
await renderComponent({ options: [], changeset });
changeset.addError({
message: 'required',
@@ -96,7 +101,7 @@ module(
});
test('It changes data-has-error attribue on error', async function (assert) {
- const changeset = await setChangeset();
+ const changeset = setChangeset();
await renderComponent({ options: [], changeset });
assert
.dom('.tpk-select-container')
@@ -117,25 +122,30 @@ module(
});
test('CSS classes exist and have been attached to the correct element', async function (assert) {
- const changeset = await setChangeset();
+ const changeset = setChangeset();
await renderComponent({ options: [], changeset });
- assert.dom(`.tpk-select-container`).exists().hasAttribute(`data-test-tpk-prefab-select-container`);
- assert.dom(`.tpk-select-container .tpk-validation-errors`).exists()
+ assert
+ .dom(`.tpk-select-container`)
+ .exists()
+ .hasAttribute(`data-test-tpk-prefab-select-container`);
+ assert.dom(`.tpk-select-container .tpk-validation-errors`).exists();
assert.dom(`.tpk-select-container .tpk-label`).exists();
});
- test('@disabled disables the select', async function(assert) {
- const changeset = await setChangeset();
+ test('@disabled disables the select', async function (assert) {
+ const changeset = setChangeset();
await renderComponent({ options: [], changeset, disabled: true });
- assert.dom(`.ember-basic-dropdown-trigger`).hasAttribute('aria-disabled', 'true');
+ assert
+ .dom(`.ember-basic-dropdown-trigger`)
+ .hasAttribute('aria-disabled', 'true');
});
test('Accessibility', async function (assert) {
assert.expect(0);
- const changeset = await setChangeset();
+ const changeset = setChangeset();
await renderComponent({ options: [], changeset, disabled: true });
await a11yAudit();
});
- },
+ }
);
diff --git a/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-textarea-test.gts b/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-textarea-test.gts
index 7d4269fb..c670c3ff 100644
--- a/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-textarea-test.gts
+++ b/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-textarea-test.gts
@@ -1,15 +1,12 @@
-
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
-import { render } from '@ember/test-helpers';
+import { render } from '@ember/test-helpers';
import { ImmerChangeset } from 'ember-immer-changeset';
import { setupIntl } from 'ember-intl/test-support';
import TpkValidationTextarea from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-textarea';
import { assertTpkCssClassesExist } from '../generic-test-functions/assert-tpk-css-classes-exist';
import { a11yAudit } from 'ember-a11y-testing/test-support';
-
-
module(
'Integration | Component | Prefabs | tpk-validation-textarea',
function (hooks) {
@@ -23,7 +20,13 @@ module(
await render(
-
+
);
@@ -43,8 +46,8 @@ module(
assertTpkCssClassesExist(assert, 'textarea', 'textarea');
});
- test('@disabled disables the textarea', async function(assert) {
- await renderComponent({ disabled: true});
+ test('@disabled disables the textarea', async function (assert) {
+ await renderComponent({ disabled: true });
assert.dom(`[data-test-tpk-textarea-input]`).hasAttribute('disabled');
});
@@ -53,5 +56,5 @@ module(
await renderComponent();
await a11yAudit();
});
- },
+ }
);
diff --git a/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-timepicker-test.gts b/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-timepicker-test.gts
index 7725a6de..fa86d89b 100644
--- a/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-timepicker-test.gts
+++ b/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-timepicker-test.gts
@@ -11,8 +11,6 @@ import {
import TpkValidationTimepicker from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-timepicker';
import { a11yAudit } from 'ember-a11y-testing/test-support';
-
-
module(
'Integration | Component | Prefabs | tpk-validation-timepicker',
function (hooks) {
@@ -28,14 +26,14 @@ module(
await render(
-
- ,
+ />
+
);
return immerChangeset;
}
@@ -71,16 +69,29 @@ module(
test('CSS classes exist and have been attached to the correct element', async function (assert) {
await renderComponentAndReturnChangeset();
- assert.dom(`.tpk-timepicker-container`).exists().hasAttribute(`data-test-tpk-prefab-timepicker-container`);
- assert.dom(`.tpk-timepicker-container .tpk-timepicker-input`).exists()
- assert.dom(`.tpk-timepicker-container .tpk-validation-errors`).exists()
- assert.dom(`.tpk-timepicker-container .tpk-label`).exists()
+ assert
+ .dom(`.tpk-timepicker-container`)
+ .exists()
+ .hasAttribute(`data-test-tpk-prefab-timepicker-container`);
+ assert.dom(`.tpk-timepicker-container .tpk-timepicker-input`).exists();
+ assert.dom(`.tpk-timepicker-container .tpk-validation-errors`).exists();
+ assert.dom(`.tpk-timepicker-container .tpk-label`).exists();
assert.dom('input').hasClass(`tpk-timepicker-input`);
- assert.dom(`label > div:first-of-type`).hasClass(`tpk-label`, `The first div inside label has the class tpk-label.`);
- assert.dom(`.tpk-timepicker-container > div:last-of-type`).hasClass(`tpk-validation-errors`, `The last div inside container has the class tpk-validation-errors.`);
+ assert
+ .dom(`label > div:first-of-type`)
+ .hasClass(
+ `tpk-label`,
+ `The first div inside label has the class tpk-label.`
+ );
+ assert
+ .dom(`.tpk-timepicker-container > div:last-of-type`)
+ .hasClass(
+ `tpk-validation-errors`,
+ `The last div inside container has the class tpk-validation-errors.`
+ );
});
- test('@disabled disables the input', async function(assert) {
+ test('@disabled disables the input', async function (assert) {
await renderComponentAndReturnChangeset({
disabled: true,
});
@@ -94,5 +105,5 @@ module(
});
await a11yAudit();
});
- },
+ }
);
diff --git a/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-vat-test.gts b/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-vat-test.gts
index 99543ce2..fd59507c 100644
--- a/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-vat-test.gts
+++ b/doc-app/tests/integration/components/ember-input-validation/prefabs/tpk-validation-vat-test.gts
@@ -7,7 +7,6 @@ import { setupIntl } from 'ember-intl/test-support';
import TpkValidationVat from '@triptyk/ember-input-validation/components/prefabs/tpk-validation-vat';
import { a11yAudit } from 'ember-a11y-testing/test-support';
-
module(
'Integration | Component | Prefabs | tpk-validation-vat',
function (hooks) {
@@ -23,15 +22,15 @@ module(
await render(
-
- ,
+ />
+
);
return immerChangeset;
}
@@ -90,7 +89,7 @@ module(
assert.dom('.tpk-validation-errors span').hasText('required');
});
- test('@disabled disables the input', async function(assert) {
+ test('@disabled disables the input', async function (assert) {
await renderComponentAndReturnChangeset({
disabled: true,
});
@@ -104,5 +103,5 @@ module(
});
await a11yAudit();
});
- },
+ }
);
diff --git a/doc-app/tests/integration/components/ember-input-validation/tpk-attributes-test.gts b/doc-app/tests/integration/components/ember-input-validation/tpk-attributes-test.gts
index 0680a20f..f9560223 100644
--- a/doc-app/tests/integration/components/ember-input-validation/tpk-attributes-test.gts
+++ b/doc-app/tests/integration/components/ember-input-validation/tpk-attributes-test.gts
@@ -2,7 +2,7 @@ import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { setupIntl } from 'ember-intl/test-support';
import { ImmerChangeset } from 'ember-immer-changeset';
-import { object, string, date, number, boolean } from 'yup';
+import { object, string, date, number, boolean } from 'zod';
import { setupCompletePrefabComponent } from './generic-test-functions/setup-prefab-component';
module('Integration | Component | tpk-attributes', function (hooks) {
@@ -29,25 +29,25 @@ module('Integration | Component | tpk-attributes', function (hooks) {
'file',
];
- const validationSchema = object().shape({
- input: string().required(),
- bic: string().required(),
- iban: string().required(),
- email: string().required(),
- mobile: string().required(),
- datepicker: date().required(),
- timepicker: date().required(),
- currency: number().required(),
- integer: number().required(),
- number: number().required(),
- password: string().required(),
- radiogroup: string().required(),
- radio: string().required(),
- select: string().required(),
- selectcreate: string().required(),
- selectsearch: string().required(),
- checkbox: boolean().required(),
- file: string().required(),
+ const validationSchema = object({
+ input: string(),
+ bic: string(),
+ iban: string(),
+ email: string(),
+ mobile: string(),
+ datepicker: date(),
+ timepicker: date(),
+ currency: number(),
+ integer: number(),
+ number: number(),
+ password: string(),
+ radiogroup: string(),
+ radio: string(),
+ select: string(),
+ selectcreate: string(),
+ selectsearch: string(),
+ checkbox: boolean(),
+ file: string(),
});
const baseChangeset = new ImmerChangeset({
@@ -77,7 +77,9 @@ module('Integration | Component | tpk-attributes', function (hooks) {
changeset: baseChangeset,
validationSchema,
});
- assert.dom(`[data-test-tpk-prefab-${prefab}-container]`).hasClass('custom-class');
+ assert
+ .dom(`[data-test-tpk-prefab-${prefab}-container]`)
+ .hasClass('custom-class');
});
}
});
diff --git a/doc-app/tests/integration/components/ember-input-validation/tpk-error-scroll-test.gts b/doc-app/tests/integration/components/ember-input-validation/tpk-error-scroll-test.gts
index 1fd29b6f..00cde176 100644
--- a/doc-app/tests/integration/components/ember-input-validation/tpk-error-scroll-test.gts
+++ b/doc-app/tests/integration/components/ember-input-validation/tpk-error-scroll-test.gts
@@ -3,8 +3,11 @@ import { setupRenderingTest } from 'ember-qunit';
import { setupIntl } from 'ember-intl/test-support';
import { timeout } from 'ember-concurrency';
import { ImmerChangeset } from 'ember-immer-changeset';
-import { object, string, date, number, boolean } from 'yup';
-import { setupCompletePrefabComponent, setupComponent } from './generic-test-functions/setup-prefab-component';
+import { object, string, date, number, boolean, email } from 'zod';
+import {
+ setupCompletePrefabComponent,
+ setupComponent,
+} from './generic-test-functions/setup-prefab-component';
module('Integration | Component | tpk-form-error-scroll', function (hooks) {
setupRenderingTest(hooks);
@@ -33,25 +36,25 @@ module('Integration | Component | tpk-form-error-scroll', function (hooks) {
'file',
];
- const validationSchema = object().shape({
- input: string().required(),
- bic: string().required(),
- iban: string().required(),
- email: string().required(),
- mobile: string().required(),
- datepicker: date().required(),
- timepicker: date().required(),
- currency: number().required(),
- integer: number().required(),
- number: number().required(),
- password: string().required(),
- radiogroup: string().required(),
- radio: string().required(),
- select: string().required(),
- selectcreate: string().required(),
- selectsearch: string().required(),
- checkbox: boolean().required(),
- file: string().required(),
+ const validationSchema = object({
+ input: string(),
+ bic: string(),
+ iban: string(),
+ email: string(),
+ mobile: string(),
+ datepicker: date(),
+ timepicker: date(),
+ currency: number(),
+ integer: number(),
+ number: number(),
+ password: string(),
+ radiogroup: string(),
+ radio: string(),
+ select: string(),
+ selectcreate: string(),
+ selectsearch: string(),
+ checkbox: boolean(),
+ file: string(),
});
const baseChangeset = new ImmerChangeset({
@@ -110,8 +113,12 @@ module('Integration | Component | tpk-form-error-scroll', function (hooks) {
test('when autoScrollOnError is false, it does not scrolls the page to the first error', async function (assert) {
const changeset = await setupComponent({
- validationSchema: object().shape({
- email: string().email().required(),
+ validationSchema: object({
+ email: email(),
+ }),
+ changeset: new ImmerChangeset({
+ email: '',
+ name: '',
}),
autoScrollOnError: false,
});
diff --git a/doc-app/tests/integration/components/ember-input-validation/tpk-form-test.gts b/doc-app/tests/integration/components/ember-input-validation/tpk-form-test.gts
index 2f4f16a7..4afd60a0 100644
--- a/doc-app/tests/integration/components/ember-input-validation/tpk-form-test.gts
+++ b/doc-app/tests/integration/components/ember-input-validation/tpk-form-test.gts
@@ -2,7 +2,7 @@ import { assert, module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { click, fillIn, render } from '@ember/test-helpers';
import { changesetGet, ImmerChangeset } from 'ember-immer-changeset';
-import { object, string, array } from 'yup';
+import { object, string, array, email, number } from 'zod';
import TpkFormService from '@triptyk/ember-input-validation/services/tpk-form';
import DummyInput from 'doc-app/components/dummy-input';
import { setupIntl } from 'ember-intl/test-support';
@@ -11,18 +11,16 @@ import { on } from '@ember/modifier';
import { concat, array as arrayHelper } from '@ember/helper';
import { setupComponent } from './generic-test-functions/setup-prefab-component';
-
-
module('Integration | Component | tpk-form', function (hooks) {
setupRenderingTest(hooks);
setupIntl(hooks, 'fr-fr');
test('TpkForm can invoke custom registered inputs from service', async function () {
const tpkFormService = this.owner.lookup(
- 'service:tpk-form',
+ 'service:tpk-form'
) as unknown as TpkFormService;
- tpkFormService.TpkInput = DummyInput;
+ tpkFormService.TpkInput = DummyInput as never;
await setupComponent();
@@ -30,10 +28,10 @@ module('Integration | Component | tpk-form', function (hooks) {
});
test('it validates the changeset when a field is set if reactive is true', async function (assert) {
- const changeset = await setupComponent( {
+ const changeset = await setupComponent({
reactive: true,
- validationSchema: object().shape({
- email: string().email().required(),
+ validationSchema: object({
+ email: email(),
}),
});
@@ -44,10 +42,38 @@ module('Integration | Component | tpk-form', function (hooks) {
assert.true(changeset.isInvalid);
});
+ test('the error message is formatted correctly when reactive is true', async function (assert) {
+ const changeset = await setupComponent({
+ reactive: true,
+ validationSchema: object({
+ name: string().min(5, 'First name must be at least 5 characters long'),
+ }),
+ });
+
+ await fillIn('[data-test-name] input', 't');
+ assert.true(changeset.isInvalid);
+
+ assert
+ .dom('[data-test-tpk-validation-errors]')
+ .hasText('First name must be at least 5 characters long');
+ });
+
+ test('it sets correct error path when single field is errored in reactive=true', async function (assert) {
+ const changeset = await setupComponent({
+ reactive: true,
+ validationSchema: object({
+ email: email(),
+ }),
+ });
+
+ await fillIn('input[type="email"]', 'test');
+ assert.true(changeset.errors.some((e) => e.key === 'email'));
+ });
+
test('It executes the changeset when submit is triggered and changeset is valid', async function (assert) {
- const changeset = await setupComponent( {
- validationSchema: object().shape({
- email: string().email().required(),
+ const changeset = await setupComponent({
+ validationSchema: object({
+ email: email(),
}),
});
@@ -61,9 +87,9 @@ module('Integration | Component | tpk-form', function (hooks) {
});
test('It triggers @onSubmit with changeset as parameter when changeset is valid', async function (assert) {
- const changeset = await setupComponent( {
- validationSchema: object().shape({
- email: string().email().required(),
+ const changeset = await setupComponent({
+ validationSchema: object({
+ email: email(),
}),
onSubmit: (changeset) => {
assert.strictEqual(changeset, changeset);
@@ -80,38 +106,56 @@ module('Integration | Component | tpk-form', function (hooks) {
assert.verifySteps(['onSubmit']);
});
+ test('Should pass errors to the prefab inputs when the changeset is invalid upon submission', async function (assert) {
+ const changeset = await setupComponent({
+ validationSchema: object({
+ name: string().length(10),
+ }),
+ });
+
+ assert.false(changeset.isInvalid);
+
+ await fillIn('[data-test-name] input', 't@g.com');
+
+ await click('button[type="submit"]');
+
+ assert.true(changeset.isInvalid);
+ assert.dom('[data-test-tpk-validation-errors]').exists();
+ assert.dom('[data-test-tpk-validation-errors]').hasAnyText();
+ });
+
test('Should display an asterisk in the label upon initialization of the form and when adding an element', async function (assert) {
- const changeset = new ImmerChangeset({
- email: '',
- address: {
- street: 'Chaussée de Binche 177A',
- city: 'Mons',
+ const changeset = new ImmerChangeset({
+ email: '',
+ address: {
+ street: 'Chaussée de Binche 177A',
+ city: 'Mons',
+ },
+ levels: [
+ {
+ name: 'Dev',
+ grade: 10,
},
- levels: [
- {
- name: 'Dev',
- grade: 10,
- },
- ],
- languages: ['French', 'English'],
- });
+ ],
+ languages: ['French', 'English'],
+ });
const onSubmit = () => {};
const reactive = true;
const validationSchema = object({
- email: string().email().required(),
- address: object({
- street: string().required(),
- city: string(),
- }),
- levels: array().of(
- object({
- name: string().required(),
- grade: string(),
- }),
- ),
- languages: array().min(1),
- });
- const addLevel = () => {
+ email: email(),
+ address: object({
+ street: string().min(1),
+ city: string(),
+ }),
+ levels: array(
+ object({
+ name: string().min(1),
+ grade: number(),
+ })
+ ),
+ languages: array(string()).min(1),
+ });
+ const addLevel = () => {
changeset.set('levels', [
...changeset.get('levels'),
{
@@ -123,20 +167,50 @@ module('Integration | Component | tpk-form', function (hooks) {
await render(
-
-
-
-
+ as |F|
+ >
+
+
+
{{#each (changesetGet changeset "levels") as |level index|}}
-
-
+
+
{{/each}}
-
- Add level
+
+ Add
+ level
Submit
diff --git a/doc-app/tests/integration/components/ember-input-validation/tpk-form-vitest-test.gts b/doc-app/tests/integration/components/ember-input-validation/tpk-form-vitest-test.gts
new file mode 100644
index 00000000..cba3712c
--- /dev/null
+++ b/doc-app/tests/integration/components/ember-input-validation/tpk-form-vitest-test.gts
@@ -0,0 +1,75 @@
+import { describe, expect } from 'vitest';
+import { renderingTest } from 'ember-vitest';
+import { click, fillIn, find, render } from '@ember/test-helpers';
+import { object, string } from 'zod';
+import ImmerChangeset from 'ember-immer-changeset';
+import TpkForm from '@triptyk/ember-input-validation/components/tpk-form';
+import TpkFormService from 'doc-app/services/tpk-form';
+import IntlService from 'ember-intl/services/intl';
+
+describe('tpk-form', () => {
+ renderingTest(
+ 'Should pass errors to the prefab inputs when the changeset is invalid upon submission',
+ async (c) => {
+ const changeset = new ImmerChangeset({});
+ const schema = object({
+ name: string().min(
+ 10,
+ 'Too small: expected string to have >=10 characters'
+ ),
+ email: string().email('Invalid email address'),
+ });
+
+ c.env.owner.register('service:tpk-form', TpkFormService);
+ c.env.owner.register('service:intl', IntlService);
+ c.env.owner.lookup('service:intl').setLocale('en-us');
+
+ const onSubmit = () => {
+ // no-op
+ };
+
+ await render(
+
+
+
+
+
+
+
+ Submit
+
+
+ );
+
+ expect(changeset.isInvalid).toBe(false);
+
+ await fillIn('[data-test-name] input', 't@g.com');
+
+ await click('button[type="submit"]');
+
+ expect(changeset.isInvalid).toBe(true);
+ expect(find('[data-test-tpk-validation-errors]')).toBeTruthy();
+ expect(find('[data-test-tpk-validation-errors]')?.textContent).toContain(
+ 'Too small: expected string to have >=10 characters'
+ );
+ }
+ );
+});
diff --git a/doc-app/tests/integration/components/ember-input-validation/tpk-validation-checkbox-test.ts b/doc-app/tests/integration/components/ember-input-validation/tpk-validation-checkbox-test.ts
deleted file mode 100644
index 47144c02..00000000
--- a/doc-app/tests/integration/components/ember-input-validation/tpk-validation-checkbox-test.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-import { module } from 'qunit';
-import { setupRenderingTest } from 'ember-qunit';
-
-module('Integration | Component | tpk-validation-checkbox', function (hooks) {
- setupRenderingTest(hooks);
-});
diff --git a/doc-app/tests/integration/components/ember-input-validation/tpk-validation-datepicker-test.gts b/doc-app/tests/integration/components/ember-input-validation/tpk-validation-datepicker-test.gts
deleted file mode 100644
index bb4565e3..00000000
--- a/doc-app/tests/integration/components/ember-input-validation/tpk-validation-datepicker-test.gts
+++ /dev/null
@@ -1,10 +0,0 @@
-import { module, test } from 'qunit';
-import { setupRenderingTest } from 'ember-qunit';
-
-module('Integration | Component | tpk-validation-datepicker', function (hooks) {
- setupRenderingTest(hooks);
-
- test('Dummy test', async function (assert) {
- assert.expect(0);
- });
-});
diff --git a/doc-app/tests/integration/components/ember-input-validation/tpk-validation-input-test.gts b/doc-app/tests/integration/components/ember-input-validation/tpk-validation-input-test.gts
index 6e6158ca..6a7a1f2e 100644
--- a/doc-app/tests/integration/components/ember-input-validation/tpk-validation-input-test.gts
+++ b/doc-app/tests/integration/components/ember-input-validation/tpk-validation-input-test.gts
@@ -1,12 +1,10 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
-import { fillIn, render } from '@ember/test-helpers';
+import { fillIn, render } from '@ember/test-helpers';
import { ImmerChangeset } from 'ember-immer-changeset';
import { setupIntl } from 'ember-intl/test-support';
import TpkValidationInput from '@triptyk/ember-input-validation/components/tpk-validation-input';
-
-
module('Integration | Component | tpk-validation-input', function (hooks) {
setupRenderingTest(hooks);
setupIntl(hooks, 'fr-fr');
@@ -14,11 +12,19 @@ module('Integration | Component | tpk-validation-input', function (hooks) {
async function renderComponent(
type: string,
onChange: (value: unknown) => void,
- changeset: ImmerChangeset,
+ changeset: ImmerChangeset
) {
await render(
-
-
+
+
+
);
}
@@ -38,15 +44,11 @@ module('Integration | Component | tpk-validation-input', function (hooks) {
assert.strictEqual(
changeset.get('name'),
'value',
- 'Value not changed in the changeset',
+ 'Value not changed in the changeset'
);
};
- await renderComponent(
- 'text',
- onChange,
- changeset,
- );
+ await renderComponent('text', onChange, changeset);
await fillIn('input', 'blah');
assert.verifySteps(['change']);
});
@@ -60,19 +62,21 @@ module('Integration | Component | tpk-validation-input', function (hooks) {
assert.strictEqual(
changeset.get('name'),
'value',
- 'Value not changed in the changeset',
+ 'Value not changed in the changeset'
);
};
await render(
-
-
+
+
+
);
await fillIn('input', 'valueChanged');
@@ -83,19 +87,20 @@ module('Integration | Component | tpk-validation-input', function (hooks) {
const changeset = setupChangeset();
await render(
-
-
- Mot de passe
-
-
-
-
+
+
+
+ Mot de passe
+
+
+
+
);
await fillIn('input', 'valueChanged');
diff --git a/doc-app/tests/integration/components/ember-input-validation/tpk-validation-radio-group-test.gts b/doc-app/tests/integration/components/ember-input-validation/tpk-validation-radio-group-test.gts
index ffbe290f..5d165d22 100644
--- a/doc-app/tests/integration/components/ember-input-validation/tpk-validation-radio-group-test.gts
+++ b/doc-app/tests/integration/components/ember-input-validation/tpk-validation-radio-group-test.gts
@@ -1,47 +1,44 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
-import { click, render } from '@ember/test-helpers';
+import { click, render } from '@ember/test-helpers';
import { ImmerChangeset } from 'ember-immer-changeset';
import { setupOnerror } from '@ember/test-helpers';
import TpkValidationRadioGroup from '@triptyk/ember-input-validation/components/tpk-validation-radio-group';
-
-
module(
'Integration | Component | tpk-validation-radio-group',
function (hooks) {
setupRenderingTest(hooks);
- async function setupComponent(
-
- value?: string | boolean,
- ) {
+ async function setupComponent(value?: string | boolean) {
const changeset = new ImmerChangeset({
radio: value,
});
await render(
-
-
-
-
-
-
-
-
-
-
- );
+
+
+
+
+
+
+
+
+
+
+
+ );
return changeset;
}
- test('render radio with default structure', async function ( assert) {
- const changeset = await setupComponent( undefined);
+ test('render radio with default structure', async function (assert) {
+ const changeset = await setupComponent(undefined);
assert.strictEqual(changeset.get('radio'), undefined);
await click("[data-test-radio='bad']");
@@ -53,19 +50,19 @@ module(
assert.strictEqual(changeset.get('radio'), 'good');
});
- test('changeset set value selected the good radio', async function ( assert) {
- await setupComponent( 'good');
+ test('changeset set value selected the good radio', async function (assert) {
+ await setupComponent('good');
assert.dom("[data-test-radio='good']").isChecked();
});
- test('must set wrong value type to selected', async function ( assert) {
+ test('must set wrong value type to selected', async function (assert) {
setupOnerror(function (err) {
assert.strictEqual(
err.message,
- 'Assertion Failed: The changeset value must be a string',
+ 'Assertion Failed: The changeset value must be a string'
);
});
- await setupComponent( true);
+ await setupComponent(true);
});
- },
+ }
);
diff --git a/doc-app/tests/integration/components/ember-input-validation/tpk-validation-radio-test.gts b/doc-app/tests/integration/components/ember-input-validation/tpk-validation-radio-test.gts
index d29973a6..a54e3462 100644
--- a/doc-app/tests/integration/components/ember-input-validation/tpk-validation-radio-test.gts
+++ b/doc-app/tests/integration/components/ember-input-validation/tpk-validation-radio-test.gts
@@ -1,11 +1,9 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
-import { click, render } from '@ember/test-helpers';
+import { click, render } from '@ember/test-helpers';
import { ImmerChangeset } from 'ember-immer-changeset';
import TpkValidationRadio from '@triptyk/ember-input-validation/components/tpk-validation-radio';
-
-
module('Integration | Component | tpk-validation-radio', function (hooks) {
setupRenderingTest(hooks);
@@ -19,26 +17,38 @@ module('Integration | Component | tpk-validation-radio', function (hooks) {
await render(
-
-
+
+
-
-
-
+
+
+
-
- ,
+
+
);
return changeset;
}
- test('render radio with default structure', async function ( assert) {
+ test('render radio with default structure', async function (assert) {
await setupComponent();
assert.dom('[data-test-tpk-label]').exists();
assert.dom('[data-test-tpk-radio-input]').exists();
});
- test('It changes data on click radio', async function ( assert) {
+ test('It changes data on click radio', async function (assert) {
const changeset = await setupComponent();
assert.strictEqual(changeset.get('radio'), undefined);
assert.dom("[data-test-radio='good']").isNotChecked();
diff --git a/doc-app/tests/integration/components/ember-input-validation/tpk-validation-textarea-test.gts b/doc-app/tests/integration/components/ember-input-validation/tpk-validation-textarea-test.gts
index 51ed3dba..458dccaa 100644
--- a/doc-app/tests/integration/components/ember-input-validation/tpk-validation-textarea-test.gts
+++ b/doc-app/tests/integration/components/ember-input-validation/tpk-validation-textarea-test.gts
@@ -4,8 +4,6 @@ import { fillIn, render } from '@ember/test-helpers';
import { ImmerChangeset } from 'ember-immer-changeset';
import TpkValidationTextarea from '@triptyk/ember-input-validation/components/tpk-validation-textarea';
-
-
module('Integration | Component | tpk-validation-textarea', function (hooks) {
setupRenderingTest(hooks);
@@ -16,7 +14,12 @@ module('Integration | Component | tpk-validation-textarea', function (hooks) {
await render(
-
+
diff --git a/doc-app/tests/integration/components/ember-input/helpers/datepicker-test.gts b/doc-app/tests/integration/components/ember-input/helpers/datepicker-test.gts
index 62b26bed..a73ed7f1 100644
--- a/doc-app/tests/integration/components/ember-input/helpers/datepicker-test.gts
+++ b/doc-app/tests/integration/components/ember-input/helpers/datepicker-test.gts
@@ -11,8 +11,6 @@ import { render } from '@ember/test-helpers';
import TpkDatepicker from '@triptyk/ember-input/components/tpk-datepicker';
-
-
module('Integration | Helpers | Datepicker', function (hooks) {
setupRenderingTest(hooks);
@@ -24,7 +22,12 @@ module('Integration | Helpers | Datepicker', function (hooks) {
return render(
-
+
@@ -32,14 +35,14 @@ module('Integration | Helpers | Datepicker', function (hooks) {
);
}
- test('clear tempus dominus helper works', async function ( assert) {
+ test('clear tempus dominus helper works', async function (assert) {
await renderDatepicker();
assert.dom(selector).hasValue('12/11/2022');
clearTempusDominusDate(selector);
assert.dom(selector).hasValue('');
});
- test('set tempus dominus date helper works', async function ( assert) {
+ test('set tempus dominus date helper works', async function (assert) {
await renderDatepicker();
const newDate: Date = new Date(2022, 10, 15);
assert.dom(selector).hasValue('12/11/2022');
@@ -47,14 +50,14 @@ module('Integration | Helpers | Datepicker', function (hooks) {
assert.dom(selector).hasValue('15/11/2022');
});
- test('open tempus dominus date picker helper works', async function ( assert) {
+ test('open tempus dominus date picker helper works', async function (assert) {
await renderDatepicker();
assert.dom('.tempus-dominus-widget').doesNotExist();
openTempusDominus(selector);
assert.dom('.tempus-dominus-widget').hasClass('show');
});
- test('close tempus dominus date picker helper works', async function ( assert) {
+ test('close tempus dominus date picker helper works', async function (assert) {
await renderDatepicker();
assert.dom('.tempus-dominus-widget').doesNotExist();
openTempusDominus(selector);
@@ -64,14 +67,14 @@ module('Integration | Helpers | Datepicker', function (hooks) {
assert.dom('.tempus-dominus-widget').hasNoClass('show');
});
- test('isOpen tempus dominus date picker helper works', async function ( assert) {
+ test('isOpen tempus dominus date picker helper works', async function (assert) {
await renderDatepicker();
openTempusDominus(selector);
assert.true(isTempusDominusOpen());
});
- test('throw error when tempus dominus date picker not exist', async function ( assert) {
+ test('throw error when tempus dominus date picker not exist', async function (assert) {
await renderDatepicker();
try {
openTempusDominus('.not-exist');
diff --git a/doc-app/tests/integration/components/ember-input/prefabs/tpk-button-test.gts b/doc-app/tests/integration/components/ember-input/prefabs/tpk-button-test.gts
index c0d6f5f4..0d0a7055 100644
--- a/doc-app/tests/integration/components/ember-input/prefabs/tpk-button-test.gts
+++ b/doc-app/tests/integration/components/ember-input/prefabs/tpk-button-test.gts
@@ -4,45 +4,49 @@ import { setupIntl } from 'ember-intl/test-support';
import { click, render } from '@ember/test-helpers';
import TpkPrefabButton from '@triptyk/ember-input/components/prefabs/tpk-prefab-button';
-module(
- 'Integration | Component | Prefabs | tpk-button',
- function (hooks) {
- setupRenderingTest(hooks);
- setupIntl(hooks, 'fr-fr');
+module('Integration | Component | Prefabs | tpk-button', function (hooks) {
+ setupRenderingTest(hooks);
+ setupIntl(hooks, 'fr-fr');
- let message = "before click"
-
- async function renderComponent(onClick: () => void, disabled: boolean = false) {
- await render(
- void,
+ disabled: boolean = false
+ ) {
+ await render(
+
+
- )
- }
- const onClick=()=> {
- message = "after click"
- }
+ />
+
+ );
+ }
+ const onClick = () => {
+ message = 'after click';
+ };
- test('Render toggle with default structure', async function (assert) {
-
- await renderComponent(onClick);
- assert.dom('[data-test-tpk-prefab-button-container]').exists();
- assert.dom('[data-test-tpk-prefab-button-container]').hasText('labelButton');
- });
+ test('Render toggle with default structure', async function (assert) {
+ await renderComponent(onClick);
+ assert.dom('[data-test-tpk-prefab-button-container]').exists();
+ assert
+ .dom('[data-test-tpk-prefab-button-container]')
+ .hasText('labelButton');
+ });
- test('Button is disabled', async function (assert) {
- await renderComponent(onClick, true);
- assert.dom('[data-test-tpk-prefab-button-container]').hasAttribute('disabled');
-
- });
+ test('Button is disabled', async function (assert) {
+ await renderComponent(onClick, true);
+ assert
+ .dom('[data-test-tpk-prefab-button-container]')
+ .hasAttribute('disabled');
+ });
- test('onClick is called', async function (assert) {
- await renderComponent(onClick);
- assert.strictEqual(message, "before click");
- await click('[data-test-tpk-prefab-button-container]');
- assert.strictEqual(message, "after click");
- });
- }
-)
\ No newline at end of file
+ test('onClick is called', async function (assert) {
+ await renderComponent(onClick);
+ assert.strictEqual(message, 'before click');
+ await click('[data-test-tpk-prefab-button-container]');
+ assert.strictEqual(message, 'after click');
+ });
+});
diff --git a/doc-app/tests/integration/components/ember-input/prefabs/tpk-search-test.gts b/doc-app/tests/integration/components/ember-input/prefabs/tpk-search-test.gts
index 3f5614c6..9e5aa18a 100644
--- a/doc-app/tests/integration/components/ember-input/prefabs/tpk-search-test.gts
+++ b/doc-app/tests/integration/components/ember-input/prefabs/tpk-search-test.gts
@@ -1,54 +1,50 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
-import { render, triggerEvent, waitFor } from '@ember/test-helpers';
+import { render, triggerEvent, waitFor } from '@ember/test-helpers';
import { setupIntl } from 'ember-intl/test-support';
import TpkSearch from '@triptyk/ember-input/components/prefabs/tpk-search';
import tpkSearchPage from '../../../../pages/tpk-search';
import { a11yAudit } from 'ember-a11y-testing/test-support';
+module('Integration | Component | Prefabs | tpk-search', function (hooks) {
+ setupRenderingTest(hooks);
+ setupIntl(hooks, 'fr-fr');
-module(
- 'Integration | Component | Prefabs | tpk-search',
- function (hooks) {
- setupRenderingTest(hooks);
- setupIntl(hooks, 'fr-fr');
+ async function renderComponent(assert: Assert) {
+ const mockSearch = () => {
+ return new Promise((res) => {
+ assert.step('search');
+ setTimeout(() => {
+ res(null);
+ }, 500);
+ });
+ };
- async function renderComponent(assert: Assert) {
- const mockSearch = () => {
- return new Promise((res) => {
- assert.step('search');
- setTimeout(() => {
- res(null);
- }, 500);
- });
- };
+ await render(
+
+
+
+ );
+ }
- await render(
-
-
-
- );
- }
+ test('render search icon by default. Switch to loader icon when onSearch is running', async function (assert) {
+ await renderComponent(assert);
+ await tpkSearchPage.input('search');
+ await triggerEvent('form', 'submit');
+ await waitFor('.tpk-search-loader');
+ assert.dom('.tpk-search-loader').exists();
+ await waitFor('[data-test-tpk-search-icon]');
+ assert.dom('[data-test-tpk-search-icon]').exists();
+ assert.verifySteps(['search']);
+ });
- test('render search icon by default. Switch to loader icon when onSearch is running', async function (assert) {
- await renderComponent(assert);
- await tpkSearchPage.input('search');
- triggerEvent('form', 'submit')
- await waitFor('.tpk-search-loader');
- assert.dom('.tpk-search-loader').exists();
- await waitFor('[data-test-tpk-search-icon]');
- assert.dom('[data-test-tpk-search-icon]').exists();
- assert.verifySteps(['search']);
- });
-
- test('Accessibility', async function (assert) {
- assert.expect(0);
- await renderComponent(assert);
- await a11yAudit();
- });
- },
-);
+ test('Accessibility', async function (assert) {
+ assert.expect(0);
+ await renderComponent(assert);
+ await a11yAudit();
+ });
+});
diff --git a/doc-app/tests/integration/components/ember-input/prefabs/tpk-toggle-test.gts b/doc-app/tests/integration/components/ember-input/prefabs/tpk-toggle-test.gts
index 510cd9a9..262793fd 100644
--- a/doc-app/tests/integration/components/ember-input/prefabs/tpk-toggle-test.gts
+++ b/doc-app/tests/integration/components/ember-input/prefabs/tpk-toggle-test.gts
@@ -1,68 +1,58 @@
-
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
-import { render } from '@ember/test-helpers';
+import { render } from '@ember/test-helpers';
import { ImmerChangeset } from 'ember-immer-changeset';
import { setupIntl } from 'ember-intl/test-support';
import TpkToggle from '@triptyk/ember-input/components/prefabs/tpk-toggle';
import { a11yAudit } from 'ember-a11y-testing/test-support';
+module('Integration | Component | Prefabs | tpk-toggle', function (hooks) {
+ setupRenderingTest(hooks);
+ setupIntl(hooks, 'fr-fr');
-module(
- 'Integration | Component | Prefabs | tpk-toggle',
- function (hooks) {
- setupRenderingTest(hooks);
- setupIntl(hooks, 'fr-fr');
-
- async function renderComponent({
- changeset,
- disabled
- }: {
- changeset: ImmerChangeset,
- disabled?: boolean,
- }) {
- await render(
-
-
- ,
- );
- return changeset;
- }
+ async function renderComponent({
+ changeset,
+ disabled,
+ }: {
+ changeset: ImmerChangeset;
+ disabled?: boolean;
+ }) {
+ await render(
+
+
+
+ );
+ return changeset;
+ }
- test('render toggle with default structure and with mandatory', async function (assert) {
- const changeset = new ImmerChangeset({
- toggle: 'applati',
- });
- await renderComponent({changeset});
- assert.dom('[data-test-tpk-label]').exists();
- assert.dom('[data-test-tpk-label]').exists();
+ test('render toggle with default structure and with mandatory', async function (assert) {
+ const changeset = new ImmerChangeset({
+ toggle: 'applati',
});
+ await renderComponent({ changeset });
+ assert.dom('[data-test-tpk-label]').exists();
+ assert.dom('[data-test-tpk-label]').exists();
+ });
- test('@disabled disables the input', async function(assert) {
- const changeset = new ImmerChangeset({
- toggle: 'applati',
- });
- await renderComponent({
- disabled: true,
- changeset
- });
- assert.dom(`[data-test-tpk-prefab-toggle-container] input`).hasAttribute('disabled');
+ test('@disabled disables the input', async function (assert) {
+ const changeset = new ImmerChangeset({
+ toggle: 'applati',
+ });
+ await renderComponent({
+ disabled: true,
+ changeset,
});
+ assert
+ .dom(`[data-test-tpk-prefab-toggle-container] input`)
+ .hasAttribute('disabled');
+ });
- test('Accessibility', async function (assert) {
- assert.expect(0);
- const changeset = new ImmerChangeset({
- toggle: 'applati',
- });
- await renderComponent({changeset});
- await a11yAudit();
+ test('Accessibility', async function (assert) {
+ assert.expect(0);
+ const changeset = new ImmerChangeset({
+ toggle: 'applati',
});
- },
-);
+ await renderComponent({ changeset });
+ await a11yAudit();
+ });
+});
diff --git a/doc-app/tests/integration/components/ember-input/tpk-button-test.gts b/doc-app/tests/integration/components/ember-input/tpk-button-test.gts
index 37d4ae80..ab26686d 100644
--- a/doc-app/tests/integration/components/ember-input/tpk-button-test.gts
+++ b/doc-app/tests/integration/components/ember-input/tpk-button-test.gts
@@ -2,49 +2,50 @@ import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import click from '@ember/test-helpers/dom/click';
-import { timeout } from 'ember-concurrency';
+import { rawTimeout, timeout } from 'ember-concurrency';
import TpkButton from '@triptyk/ember-input/components/tpk-button';
-
-
-module('Integration | Component | tpk-button', function ( hooks) {
+module('Integration | Component | tpk-button', function (hooks) {
setupRenderingTest(hooks);
async function spamClickElement() {
- click('[data-test-tpk-button]');
- click('[data-test-tpk-button]');
- click('[data-test-tpk-button]');
+ await click('[data-test-tpk-button]');
+ await click('[data-test-tpk-button]');
+ await click('[data-test-tpk-button]');
await click('[data-test-tpk-button]');
}
async function renderComponent(assert: Assert, allowSpam: boolean) {
const onClick = async () => {
- await timeout(1000);
+ await rawTimeout(100);
assert.step('onClick');
};
- await render(
-
- Click me
-
+ await render(
+
+
+ Click me
+
);
await spamClickElement();
}
- test('it prevents spam click by default', async function ( assert) {
+ test('it prevents spam click by default', async function (assert) {
await renderComponent(assert, false);
+ await timeout(200);
assert.verifySteps(['onClick']);
});
- test('if @allowSpam is true, it does not prevent spamClick', async function ( assert) {
+ test('if @allowSpam is true, it does not prevent spamClick', async function (assert) {
await renderComponent(assert, true);
+ await timeout(500);
assert.verifySteps(['onClick', 'onClick', 'onClick', 'onClick']);
});
});
diff --git a/doc-app/tests/integration/components/ember-input/tpk-checkbox-test.gts b/doc-app/tests/integration/components/ember-input/tpk-checkbox-test.gts
index 1185a8e2..642d01c5 100644
--- a/doc-app/tests/integration/components/ember-input/tpk-checkbox-test.gts
+++ b/doc-app/tests/integration/components/ember-input/tpk-checkbox-test.gts
@@ -1,16 +1,13 @@
-
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import click from '@ember/test-helpers/dom/click';
-import { getOwner } from '@ember/application';
+import { getOwner } from '@ember/owner';
import ApplicationInstance from '@ember/application/instance';
import CatchState from 'doc-app/services/catch-state';
import TpkCheckbox from '@triptyk/ember-input/components/tpk-checkbox';
import catchState from 'doc-app/helpers/catch-state';
-
-
module('Integration | Component | ui/checkbox', function (hooks) {
setupRenderingTest(hooks);
@@ -24,17 +21,19 @@ module('Integration | Component | ui/checkbox', function (hooks) {
assert.true(checked);
};
- await render(
+ await render(
+
-
-
+
+
- );
+
+ );
await click('label');
assert.dom('input.text-yellow-300').exists();
@@ -47,21 +46,21 @@ module('Integration | Component | ui/checkbox', function (hooks) {
test('input yield only', async function (assert) {
await render(
-
- {{catchState O}}
-
- ,
+
+
+ {{catchState O}}
+
+
);
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- const { state }: { state: any } = (
- getOwner(this) as ApplicationInstance
- ).lookup('service:catch-state') as CatchState;
+ const { state } = (getOwner(this) as ApplicationInstance).lookup(
+ 'service:catch-state'
+ ) as CatchState>;
- assert.strictEqual(typeof state.Input, 'object');
- assert.strictEqual(typeof state.onChange, 'function');
- assert.strictEqual(typeof state.Label, 'object');
- assert.strictEqual(typeof state.changeEvent, 'string');
- assert.strictEqual(typeof state.guid, 'string');
+ assert.strictEqual(typeof state?.Input, 'object');
+ assert.strictEqual(typeof state?.onChange, 'function');
+ assert.strictEqual(typeof state?.Label, 'object');
+ assert.strictEqual(typeof state?.changeEvent, 'string');
+ assert.strictEqual(typeof state?.guid, 'string');
});
});
diff --git a/doc-app/tests/integration/components/ember-input/tpk-datepicker-test.gts b/doc-app/tests/integration/components/ember-input/tpk-datepicker-test.gts
index 596ded3e..ea37bcdd 100644
--- a/doc-app/tests/integration/components/ember-input/tpk-datepicker-test.gts
+++ b/doc-app/tests/integration/components/ember-input/tpk-datepicker-test.gts
@@ -14,9 +14,6 @@ import {
} from '@triptyk/ember-input/test-support/datepicker-helpers';
import TpkDatepicker from '@triptyk/ember-input/components/tpk-datepicker';
-
-
-
module('Integration | Component | tpk-datepicker', function (hooks) {
setupRenderingTest(hooks);
@@ -29,7 +26,12 @@ module('Integration | Component | tpk-datepicker', function (hooks) {
await render(
-
+
@@ -46,7 +48,12 @@ module('Integration | Component | tpk-datepicker', function (hooks) {
await render(
-
+
@@ -55,25 +62,35 @@ module('Integration | Component | tpk-datepicker', function (hooks) {
assert.dom('.tpk-datepicker-input-input').hasValue('13/11/2022');
});
- test('datepicker is disabled', async function ( assert) {
+ test('datepicker is disabled', async function (assert) {
await render(
-
-
-
+
+
+
);
assert.dom('.tpk-datepicker-input-input').hasAttribute('disabled');
});
- test('datepicker use current date', async function ( assert) {
+ test('datepicker use current date', async function (assert) {
const date: Date = new Date();
const formattedDate = `${date.getDate().toString().padStart(2, '0')}/${(date.getMonth() + 1).toString().padStart(2, '0')}/${date.getFullYear()}`;
await render(
-
+
@@ -93,7 +110,14 @@ module('Integration | Component | tpk-datepicker', function (hooks) {
await render(
-
+
@@ -116,7 +140,14 @@ module('Integration | Component | tpk-datepicker', function (hooks) {
await render(
-
+
@@ -131,12 +162,19 @@ module('Integration | Component | tpk-datepicker', function (hooks) {
skip('datepicker range with default value', async function (assert) {
const date: Date = new Date(2022, 10, 13);
const date2: Date = new Date(2022, 10, 16);
- const value = [date, date2];
+ const value = [date, date2] as [Date, Date];
const setDate = function () {};
await render(
-
+
@@ -156,7 +194,14 @@ module('Integration | Component | tpk-datepicker', function (hooks) {
await render(
-
+
@@ -174,10 +219,18 @@ module('Integration | Component | tpk-datepicker', function (hooks) {
await render(
-
-
-
-
+
+
+
+
);
openTempusDominus('.tpk-datepicker-input-input');
@@ -190,10 +243,17 @@ module('Integration | Component | tpk-datepicker', function (hooks) {
await render(
-
-
-
-
+
+
+
+
);
openTempusDominus('.tpk-datepicker-input-input');
@@ -208,10 +268,16 @@ module('Integration | Component | tpk-datepicker', function (hooks) {
await render(
-
-
-
-
+
+
+
+
);
openTempusDominus('.tpk-datepicker-input-input');
@@ -223,11 +289,18 @@ module('Integration | Component | tpk-datepicker', function (hooks) {
await render(
-
-
-
-
-
+
+
+
+
+
);
await fillIn('.tpk-datepicker-input-input', '13/11-2022');
assert.dom('.tpk-datepicker-input-input').hasValue('13/11-2022');
@@ -239,10 +312,18 @@ module('Integration | Component | tpk-datepicker', function (hooks) {
await render(
-
-
-
-
+
+
+
+
+
);
setTempusDominusDate('.tpk-datepicker-input-input', date);
assert.dom('.tpk-datepicker-input-input').hasValue('15/11/2022 | 08:30');
@@ -254,10 +335,17 @@ module('Integration | Component | tpk-datepicker', function (hooks) {
await render(
-
-
-
-
+
+
+
+
+
);
openTempusDominus('.tpk-datepicker-input-input');
assert.dom('.picker-switch').hasText('octubre de 22');
@@ -268,10 +356,17 @@ module('Integration | Component | tpk-datepicker', function (hooks) {
await render(
-
-
-
-
+
+
+
+
+
);
openTempusDominus('.tpk-datepicker-input-input');
assert.dom('.icon.icon-today').exists();
@@ -282,10 +377,18 @@ module('Integration | Component | tpk-datepicker', function (hooks) {
await render(
-
-
-
-
+
+
+
+
+
+
);
openTempusDominus('.tpk-datepicker-input-input');
diff --git a/doc-app/tests/integration/components/ember-input/tpk-file-test.gts b/doc-app/tests/integration/components/ember-input/tpk-file-test.gts
index 0486a737..8f24e0f8 100644
--- a/doc-app/tests/integration/components/ember-input/tpk-file-test.gts
+++ b/doc-app/tests/integration/components/ember-input/tpk-file-test.gts
@@ -1,8 +1,7 @@
-
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
-import { getOwner } from '@ember/application';
+import { getOwner } from '@ember/owner';
import ApplicationInstance from '@ember/application/instance';
import CatchState from 'doc-app/services/catch-state';
import catchState from 'doc-app/helpers/catch-state';
@@ -20,16 +19,15 @@ module('Integration | Component | tpk-file', function (hooks) {
);
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- const { state }: { state: any } = (
- getOwner(this) as ApplicationInstance
- ).lookup('service:catch-state') as CatchState;
+ const { state } = (getOwner(this) as ApplicationInstance).lookup(
+ 'service:catch-state'
+ ) as CatchState>;
- assert.strictEqual(typeof state.onChange, 'function');
- assert.strictEqual(typeof state.Input, 'object');
- assert.strictEqual(typeof state.Label, 'object');
- assert.strictEqual(typeof state.changeEvent, 'string');
- assert.strictEqual(typeof state.guid, 'string');
- assert.true(Array.isArray(state.files));
+ assert.strictEqual(typeof state?.onChange, 'function');
+ assert.strictEqual(typeof state?.Input, 'object');
+ assert.strictEqual(typeof state?.Label, 'object');
+ assert.strictEqual(typeof state?.changeEvent, 'string');
+ assert.strictEqual(typeof state?.guid, 'string');
+ assert.true(Array.isArray(state?.files));
});
});
diff --git a/doc-app/tests/integration/components/ember-input/tpk-input-test.gts b/doc-app/tests/integration/components/ember-input/tpk-input-test.gts
index 0b77cfef..b9a8e3df 100644
--- a/doc-app/tests/integration/components/ember-input/tpk-input-test.gts
+++ b/doc-app/tests/integration/components/ember-input/tpk-input-test.gts
@@ -1,36 +1,33 @@
-
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render, fillIn } from '@ember/test-helpers';
-import { getOwner } from '@ember/application';
+import { getOwner } from '@ember/owner';
import ApplicationInstance from '@ember/application/instance';
import CatchState from 'doc-app/services/catch-state';
import catchState from 'doc-app/helpers/catch-state';
import TpkInput from '@triptyk/ember-input/components/tpk-input';
-
-
module('Integration | Component | tpk-input', function (hooks) {
setupRenderingTest(hooks);
test('input yield only', async function (assert) {
await render(
-
- {{catchState O}}
-
+
+
+ {{catchState O}}
+
);
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- const { state }: { state: any } = (
- getOwner(this) as ApplicationInstance
- ).lookup('service:catch-state') as CatchState;
+ const { state } = (getOwner(this) as ApplicationInstance).lookup(
+ 'service:catch-state'
+ ) as CatchState>;
- assert.strictEqual(typeof state.Input, 'object', 'Input');
- assert.strictEqual(typeof state.changeEvent, 'string', 'changeEvent');
- assert.strictEqual(typeof state.Label, 'object', 'Label');
- assert.strictEqual(typeof state.guid, 'string', 'guid');
+ assert.strictEqual(typeof state?.['Input'], 'object', 'Input');
+ assert.strictEqual(typeof state?.['changeEvent'], 'string', 'changeEvent');
+ assert.strictEqual(typeof state?.['Label'], 'object', 'Label');
+ assert.strictEqual(typeof state?.['guid'], 'string', 'guid');
});
test('input with mask return masked value', async function (assert) {
@@ -45,11 +42,17 @@ module('Integration | Component | tpk-input', function (hooks) {
};
await render(
-
-
-
-
-
+
+
+
+
);
@@ -68,10 +71,20 @@ module('Integration | Component | tpk-input', function (hooks) {
assert.strictEqual(e, `${valueToApply}`);
};
await render(
-
-
-
-
+
+
+
+
+
+
);
await fillIn('[data-test-tpk-input-input]', valueToApply);
@@ -88,10 +101,20 @@ module('Integration | Component | tpk-input', function (hooks) {
const mask = `${maskPrefix}${maskContent}`;
const change = () => {};
await render(
-
-
-
-
+
+
+
+
+
);
assert.dom('[data-test-tpk-input-input]').hasValue(`${maskPrefix}####`);
@@ -103,10 +126,18 @@ module('Integration | Component | tpk-input', function (hooks) {
assert.strictEqual(e, 123);
};
await render(
-
-
-
-
+
+
+
+
+
+
);
await fillIn('[data-test-tpk-input-input]', '123');
diff --git a/doc-app/tests/integration/components/ember-input/tpk-input-textarea-test.gts b/doc-app/tests/integration/components/ember-input/tpk-input-textarea-test.gts
index a3071aa9..730736ee 100644
--- a/doc-app/tests/integration/components/ember-input/tpk-input-textarea-test.gts
+++ b/doc-app/tests/integration/components/ember-input/tpk-input-textarea-test.gts
@@ -1,16 +1,13 @@
-
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
-import { getOwner } from '@ember/application';
+import { getOwner } from '@ember/owner';
import ApplicationInstance from '@ember/application/instance';
import CatchState from 'doc-app/services/catch-state';
import { fillIn } from '@ember/test-helpers';
import TpkTextarea from '@triptyk/ember-input/components/tpk-textarea';
import catchState from 'doc-app/helpers/catch-state';
-
-
module('Integration | Component | tpk-area', function (hooks) {
setupRenderingTest(hooks);
@@ -30,34 +27,33 @@ module('Integration | Component | tpk-area', function (hooks) {
await renderComponent();
const service = (getOwner(this) as ApplicationInstance).lookup(
- 'service:catch-state',
+ 'service:catch-state'
) as CatchState;
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- const state = service.state as any;
+ const state = service.state as { [key: string]: unknown };
- assert.strictEqual(typeof state.Input, 'object');
- assert.strictEqual(typeof state.onChange, 'function');
- assert.strictEqual(typeof state.Label, 'object');
- assert.strictEqual(typeof state.changeEvent, 'string');
- assert.strictEqual(typeof state.guid, 'string');
- assert.strictEqual(typeof state.maxLength, 'undefined');
+ assert.strictEqual(typeof state['Input'], 'object');
+ assert.strictEqual(typeof state['onChange'], 'function');
+ assert.strictEqual(typeof state['Label'], 'object');
+ assert.strictEqual(typeof state['changeEvent'], 'string');
+ assert.strictEqual(typeof state['guid'], 'string');
+ assert.strictEqual(typeof state['maxLength'], 'undefined');
});
test('charcount updates when input value change', async function (assert) {
await renderComponent();
const stateService = (getOwner(this) as ApplicationInstance).lookup(
- 'service:catch-state',
+ 'service:catch-state'
) as CatchState;
assert.strictEqual(
(stateService.state as Record<'charCount', number>).charCount,
- 5,
+ 5
);
await fillIn('textarea', 'test');
assert.strictEqual(
(stateService.state as Record<'charCount', number>).charCount,
- 4,
+ 4
);
});
});
diff --git a/doc-app/tests/integration/components/ember-input/tpk-radio-test.gts b/doc-app/tests/integration/components/ember-input/tpk-radio-test.gts
index 3d5a3b89..494ce5d1 100644
--- a/doc-app/tests/integration/components/ember-input/tpk-radio-test.gts
+++ b/doc-app/tests/integration/components/ember-input/tpk-radio-test.gts
@@ -1,17 +1,12 @@
-
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import click from '@ember/test-helpers/dom/click';
-import { getOwner } from '@ember/application';
+import { getOwner } from '@ember/owner';
import ApplicationInstance from '@ember/application/instance';
-import CatchState from 'doc-app/services/catch-state';
import TpkRadio from '@triptyk/ember-input/components/tpk-radio';
import catchState from 'doc-app/helpers/catch-state';
-
-
-
module('Integration | Component | ui/radio', function (hooks) {
setupRenderingTest(hooks);
@@ -24,19 +19,21 @@ module('Integration | Component | ui/radio', function (hooks) {
assert.strictEqual(selected, 'jean');
};
- await render(
+ await render(
+
-
-
+
+
- );
+
+ );
await click('label');
assert.dom('input.text-yellow-300').exists();
@@ -49,20 +46,27 @@ module('Integration | Component | ui/radio', function (hooks) {
test('input yield only', async function (assert) {
await render(
-
- {{catchState O}}
-
+
+
+ {{catchState O}}
+
+
);
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- const { state }: { state: any } = (
- getOwner(this) as ApplicationInstance
- ).lookup('service:catch-state') as CatchState;
+ const { state } = (getOwner(this) as ApplicationInstance).lookup(
+ 'service:catch-state'
+ ) as { state: Record };
- assert.strictEqual(typeof state.Input, 'object');
- assert.strictEqual(typeof state.onChange, 'function');
- assert.strictEqual(typeof state.Label, 'object');
- assert.strictEqual(typeof state.changeEvent, 'string');
- assert.strictEqual(typeof state.guid, 'string');
+ assert.strictEqual(typeof state['Input'], 'object');
+ assert.strictEqual(typeof state['onChange'], 'function');
+ assert.strictEqual(typeof state['Label'], 'object');
+ assert.strictEqual(typeof state['changeEvent'], 'string');
+ assert.strictEqual(typeof state['guid'], 'string');
});
});
diff --git a/doc-app/tests/integration/components/ember-ui/action-menu-test.gts b/doc-app/tests/integration/components/ember-ui/action-menu-test.gts
index e57176a9..92c737b1 100644
--- a/doc-app/tests/integration/components/ember-ui/action-menu-test.gts
+++ b/doc-app/tests/integration/components/ember-ui/action-menu-test.gts
@@ -7,21 +7,18 @@ import TpkActionsMenu from '@triptyk/ember-ui/components/tpk-actions-menu';
module('Integration | Component | Action Menu', function (hooks) {
setupRenderingTest(hooks);
- async function renderActionMenu( assert: Assert, iconSrc?: string) {
+ async function renderActionMenu(assert: Assert, iconSrc?: string) {
const act = () => {
assert.step('action');
};
return render(
-
-
- ActionText
-
-
+
+
+ ActionText
+
+
);
}
diff --git a/doc-app/tests/integration/components/ember-ui/confirm-modal-test.gts b/doc-app/tests/integration/components/ember-ui/confirm-modal-test.gts
index b4bc8ded..7e7476c8 100644
--- a/doc-app/tests/integration/components/ember-ui/confirm-modal-test.gts
+++ b/doc-app/tests/integration/components/ember-ui/confirm-modal-test.gts
@@ -4,18 +4,10 @@ import { render } from '@ember/test-helpers';
import { confirmModalObject } from 'doc-app/tests/pages/ember-confirm-modal';
import TpkConfirmModal from '@triptyk/ember-ui/components/tpk-confirm-modal';
-
-
module('Integration | Component | Confirm Modal', function (hooks) {
setupRenderingTest(hooks);
-
- async function renderConfirmModal(
-
- // eslint-disable-next-line no-undef
- assert: Assert,
- isOpen = true,
- ) {
+ async function renderConfirmModal(assert: Assert, isOpen = true) {
const onClose = function () {
assert.step('onClose');
};
@@ -24,44 +16,46 @@ module('Integration | Component | Confirm Modal', function (hooks) {
};
const confirmQuestion = 'Do you confirm ? :smirk:';
- return render(
-
-
-
- Confirmez banane
-
-
- Annuler banane
-
-
- );
+ return render(
+
+
+
+
+ Confirmez banane
+
+
+ Annuler banane
+
+
+
+ );
}
test('@onConfirm is called when confirm is clicked', async function (assert) {
- await renderConfirmModal( assert);
+ await renderConfirmModal(assert);
await confirmModalObject.confirm.click();
assert.verifySteps(['onConfirm']);
});
test('@onClose is called when cancel is clicked', async function (assert) {
- await renderConfirmModal( assert);
+ await renderConfirmModal(assert);
await confirmModalObject.cancel.click();
assert.verifySteps(['onClose']);
});
test('Modal is open if @isOpen is true', async function (assert) {
- await renderConfirmModal( assert);
+ await renderConfirmModal(assert);
assert.dom(confirmModalObject.scope).exists();
});
test('Modal is close if @isOpen is false', async function (assert) {
- await renderConfirmModal( assert, false);
+ await renderConfirmModal(assert, false);
assert.dom(confirmModalObject.scope).doesNotExist();
});
});
diff --git a/doc-app/tests/integration/components/ember-ui/modal-test.gts b/doc-app/tests/integration/components/ember-ui/modal-test.gts
index cb9510ac..47c020ed 100644
--- a/doc-app/tests/integration/components/ember-ui/modal-test.gts
+++ b/doc-app/tests/integration/components/ember-ui/modal-test.gts
@@ -1,17 +1,17 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
-import {
- click,
- render,
- triggerKeyEvent,
-} from '@ember/test-helpers';
+import { click, render, triggerKeyEvent } from '@ember/test-helpers';
import TpkModal from '@triptyk/ember-ui/components/tpk-modal';
import { find } from '@ember/test-helpers';
module('Integration | Component | modal', function (hooks) {
setupRenderingTest(hooks);
- async function setupComponent(isOpen: boolean, assert: Assert, handler?: (e: MouseEvent | TouchEvent) => boolean) {
+ async function setupComponent(
+ isOpen: boolean,
+ assert: Assert,
+ handler?: (e: MouseEvent | TouchEvent) => boolean
+ ) {
const title = 'My modal';
const onClose = () => {
assert.step('onClose');
@@ -19,19 +19,20 @@ module('Integration | Component | modal', function (hooks) {
await render(
-
-
-
-
- Content
-
-
+
+
+
+
+ Content
+
+
);
}
@@ -62,7 +63,6 @@ module('Integration | Component | modal', function (hooks) {
assert.verifySteps(['onClose', 'onClose']);
});
-
test('if defined outsideClickHandler is called if click outside', async function (assert) {
const handler = () => {
assert.step('handler');
diff --git a/doc-app/tests/integration/components/ember-ui/prefabs/tpk-confirm-modal-prefab-test.gts b/doc-app/tests/integration/components/ember-ui/prefabs/tpk-confirm-modal-prefab-test.gts
index 0470175a..97aa13f8 100644
--- a/doc-app/tests/integration/components/ember-ui/prefabs/tpk-confirm-modal-prefab-test.gts
+++ b/doc-app/tests/integration/components/ember-ui/prefabs/tpk-confirm-modal-prefab-test.gts
@@ -5,54 +5,56 @@ import { render } from '@ember/test-helpers';
import TpkConfirmModalPrefab from '@triptyk/ember-ui/components/prefabs/tpk-confirm-modal-prefab';
import { confirmModalObject } from 'doc-app/tests/pages/ember-confirm-modal';
-module('Integration | Component | Prefabs | Tpk-confirm-modal-prefab', function(hooks) {
- setupRenderingTest(hooks);
- setupIntl(hooks, 'fr-fr');
+module(
+ 'Integration | Component | Prefabs | Tpk-confirm-modal-prefab',
+ function (hooks) {
+ setupRenderingTest(hooks);
+ setupIntl(hooks, 'fr-fr');
- async function renderComponent( assert: Assert, isOpen = true) {
+ async function renderComponent(assert: Assert, isOpen = true) {
+ const onClose = function () {
+ assert.step('onClose');
+ };
+ const onConfirm = function () {
+ assert.step('onConfirm');
+ };
+ const confirmQuestion = 'Do you confirm ? :smirk:';
+ await render(
+
+
+
+
+
+ );
+ }
- const onClose = function () {
- assert.step('onClose');
- };
- const onConfirm = function () {
- assert.step('onConfirm');
- };
- const confirmQuestion = 'Do you confirm ? :smirk:';
- await render(
-
-
-
-
-
- );
- }
-
- test('Render prefab confirm modal', async function(assert) {
- await renderComponent(assert)
- assert.dom('[data-test-confirm-modal-container]').exists();
- });
+ test('Render prefab confirm modal', async function (assert) {
+ await renderComponent(assert);
+ assert.dom('[data-test-confirm-modal-container]').exists();
+ });
- test('@onClose is called when cancel is clicked', async function (assert) {
- await renderComponent(assert)
- await confirmModalObject.cancel.click();
- assert.verifySteps(['onClose']);
- });
-
- test('Modal is open if @isOpen is true', async function (assert) {
- await renderComponent(assert)
- assert.dom(confirmModalObject.scope).exists();
- });
+ test('@onClose is called when cancel is clicked', async function (assert) {
+ await renderComponent(assert);
+ await confirmModalObject.cancel.click();
+ assert.verifySteps(['onClose']);
+ });
- test('Modal is close if @isOpen is false', async function (assert) {
- await renderComponent( assert, false);
- assert.dom(confirmModalObject.scope).doesNotExist();
- });
-});
+ test('Modal is open if @isOpen is true', async function (assert) {
+ await renderComponent(assert);
+ assert.dom(confirmModalObject.scope).exists();
+ });
+ test('Modal is close if @isOpen is false', async function (assert) {
+ await renderComponent(assert, false);
+ assert.dom(confirmModalObject.scope).doesNotExist();
+ });
+ }
+);
diff --git a/doc-app/tests/integration/components/ember-ui/prefabs/tpk-forgot-password-prefab-test.gts b/doc-app/tests/integration/components/ember-ui/prefabs/tpk-forgot-password-prefab-test.gts
new file mode 100644
index 00000000..28dc427b
--- /dev/null
+++ b/doc-app/tests/integration/components/ember-ui/prefabs/tpk-forgot-password-prefab-test.gts
@@ -0,0 +1,112 @@
+import { module, test } from 'qunit';
+import { setupRenderingTest } from 'ember-qunit';
+import { setupIntl } from 'ember-intl/test-support';
+import { render } from '@ember/test-helpers';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import { object, email } from 'zod';
+import TpkForgotPassword from '@triptyk/ember-ui/components/prefabs/tpk-forgot-password';
+import forgotPasswordPageObject from 'doc-app/tests/pages/tpk-forgot-password';
+
+module(
+ 'Integration | Component | Prefabs | Tpk-forgot-password-prefab',
+ function (hooks) {
+ setupRenderingTest(hooks);
+ setupIntl(hooks, 'fr-fr');
+
+ const forgotPasswordSchema = object({
+ email: email(),
+ });
+
+ async function renderComponent(params?: {
+ onSubmit?: (data: unknown, changeset: ImmerChangeset) => void;
+ initialValues?: { email: string };
+ submitButtonText?: string;
+ }) {
+ const onSubmit = params?.onSubmit ?? (() => {});
+ const initialValues = params?.initialValues;
+ const submitButtonText = params?.submitButtonText;
+
+ await render(
+
+
+
+ );
+ }
+
+ test('renders forgot password form with email field', async function (assert) {
+ await renderComponent();
+ assert.dom(forgotPasswordPageObject.scope).exists();
+ assert.dom('[data-test-tpk-forgot-password-form-email]').exists();
+ assert.dom(forgotPasswordPageObject.submitButton.scope).exists();
+ });
+
+ test('displays default submit button text', async function (assert) {
+ await renderComponent();
+ assert.strictEqual(
+ forgotPasswordPageObject.submitButton.text,
+ 'Send Reset Link'
+ );
+ });
+
+ test('displays custom submit button text', async function (assert) {
+ await renderComponent({ submitButtonText: 'Envoyer le lien' });
+ assert.strictEqual(
+ forgotPasswordPageObject.submitButton.text,
+ 'Envoyer le lien'
+ );
+ });
+
+ test('uses initial values when provided', async function (assert) {
+ await renderComponent({
+ initialValues: {
+ email: 'test@example.com',
+ },
+ });
+ assert.strictEqual(
+ forgotPasswordPageObject.email.value,
+ 'test@example.com'
+ );
+ });
+
+ test('onSubmit is called with data and changeset when form is valid', async function (assert) {
+ let receivedData: unknown;
+ let receivedChangeset: ImmerChangeset | undefined;
+
+ await renderComponent({
+ onSubmit: (data, changeset) => {
+ receivedData = data;
+ receivedChangeset = changeset;
+ assert.step('onSubmit');
+ },
+ });
+
+ await forgotPasswordPageObject.email.fillIn('test@example.com');
+ await forgotPasswordPageObject.submitButton.click();
+
+ assert.verifySteps(['onSubmit']);
+ assert.deepEqual(receivedData, {
+ email: 'test@example.com',
+ });
+ assert.ok(receivedChangeset instanceof ImmerChangeset);
+ assert.strictEqual(receivedChangeset?.get('email'), 'test@example.com');
+ });
+
+ test('onSubmit is not called when form is invalid', async function (assert) {
+ await renderComponent({
+ onSubmit: () => {
+ assert.step('onSubmit');
+ },
+ });
+
+ await forgotPasswordPageObject.email.fillIn('invalid-email');
+ await forgotPasswordPageObject.submitButton.click();
+
+ assert.verifySteps([]);
+ });
+ }
+);
diff --git a/doc-app/tests/integration/components/ember-ui/prefabs/tpk-login-prefab-test.gts b/doc-app/tests/integration/components/ember-ui/prefabs/tpk-login-prefab-test.gts
new file mode 100644
index 00000000..d4c0d1ab
--- /dev/null
+++ b/doc-app/tests/integration/components/ember-ui/prefabs/tpk-login-prefab-test.gts
@@ -0,0 +1,125 @@
+import { module, test } from 'qunit';
+import { setupRenderingTest } from 'ember-qunit';
+import { setupIntl } from 'ember-intl/test-support';
+import { render } from '@ember/test-helpers';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import { object, email, string } from 'zod';
+import TpkLogin from '@triptyk/ember-ui/components/prefabs/tpk-login';
+import loginPageObject from 'doc-app/tests/pages/tpk-login';
+
+module(
+ 'Integration | Component | Prefabs | Tpk-login-prefab',
+ function (hooks) {
+ setupRenderingTest(hooks);
+ setupIntl(hooks, 'fr-fr');
+
+ const loginSchema = object({
+ email: email(),
+ password: string().min(1),
+ });
+
+ async function renderComponent(params?: {
+ onSubmit?: (data: unknown, changeset: ImmerChangeset) => void;
+ initialValues?: { email: string; password: string };
+ submitButtonText?: string;
+ }) {
+ const onSubmit = params?.onSubmit ?? (() => {});
+ const initialValues = params?.initialValues;
+ const submitButtonText = params?.submitButtonText;
+
+ await render(
+
+
+
+ );
+ }
+
+ test('renders login form with email and password fields', async function (assert) {
+ await renderComponent();
+ assert.dom(loginPageObject.scope).exists();
+ assert.dom('[data-test-tpk-login-form-email]').exists();
+ assert.dom('[data-test-tpk-login-form-password]').exists();
+ assert.dom(loginPageObject.submitButton.scope).exists();
+ });
+
+ test('displays default submit button text', async function (assert) {
+ await renderComponent();
+ assert.strictEqual(loginPageObject.submitButton.text, 'Sign in');
+ });
+
+ test('displays custom submit button text', async function (assert) {
+ await renderComponent({ submitButtonText: 'Connexion' });
+ assert.strictEqual(loginPageObject.submitButton.text, 'Connexion');
+ });
+
+ test('uses initial values when provided', async function (assert) {
+ await renderComponent({
+ initialValues: {
+ email: 'test@example.com',
+ password: 'initialPassword',
+ },
+ });
+ assert.strictEqual(loginPageObject.email.value, 'test@example.com');
+ assert.strictEqual(loginPageObject.password.value, 'initialPassword');
+ });
+
+ test('onSubmit is called with data and changeset when form is valid', async function (assert) {
+ let receivedData: unknown;
+ let receivedChangeset: ImmerChangeset | undefined;
+
+ await renderComponent({
+ onSubmit: (data, changeset) => {
+ receivedData = data;
+ receivedChangeset = changeset;
+ assert.step('onSubmit');
+ },
+ });
+
+ await loginPageObject.email.fillIn('test@example.com');
+ await loginPageObject.password.fillIn('password123');
+ await loginPageObject.submitButton.click();
+
+ assert.verifySteps(['onSubmit']);
+ assert.deepEqual(receivedData, {
+ email: 'test@example.com',
+ password: 'password123',
+ });
+ assert.ok(receivedChangeset instanceof ImmerChangeset);
+ assert.strictEqual(receivedChangeset?.get('email'), 'test@example.com');
+ assert.strictEqual(receivedChangeset?.get('password'), 'password123');
+ });
+
+ test('onSubmit is not called when form is invalid', async function (assert) {
+ await renderComponent({
+ onSubmit: () => {
+ assert.step('onSubmit');
+ },
+ });
+
+ await loginPageObject.email.fillIn('invalid-email');
+ await loginPageObject.password.fillIn('password123');
+ await loginPageObject.submitButton.click();
+
+ assert.verifySteps([]);
+ });
+
+ test('onSubmit is not called when password is empty', async function (assert) {
+ await renderComponent({
+ onSubmit: () => {
+ assert.step('onSubmit');
+ },
+ });
+
+ await loginPageObject.email.fillIn('test@example.com');
+ await loginPageObject.password.fillIn('');
+ await loginPageObject.submitButton.click();
+
+ assert.verifySteps([]);
+ });
+ }
+);
diff --git a/doc-app/tests/integration/components/ember-ui/prefabs/tpk-reset-password-prefab-test.gts b/doc-app/tests/integration/components/ember-ui/prefabs/tpk-reset-password-prefab-test.gts
new file mode 100644
index 00000000..2bc00cb1
--- /dev/null
+++ b/doc-app/tests/integration/components/ember-ui/prefabs/tpk-reset-password-prefab-test.gts
@@ -0,0 +1,142 @@
+import { module, test } from 'qunit';
+import { setupRenderingTest } from 'ember-qunit';
+import { setupIntl } from 'ember-intl/test-support';
+import { render } from '@ember/test-helpers';
+import { ImmerChangeset } from 'ember-immer-changeset';
+import { object, string } from 'zod';
+import TpkResetPassword from '@triptyk/ember-ui/components/prefabs/tpk-reset-password';
+import resetPasswordPageObject from 'doc-app/tests/pages/tpk-reset-password';
+
+module(
+ 'Integration | Component | Prefabs | Tpk-reset-password-prefab',
+ function (hooks) {
+ setupRenderingTest(hooks);
+ setupIntl(hooks, 'fr-fr');
+
+ const resetPasswordSchema = object({
+ password: string().min(8),
+ confirmPassword: string().min(8),
+ });
+
+ async function renderComponent(params?: {
+ onSubmit?: (data: unknown, changeset: ImmerChangeset) => void;
+ initialValues?: { password: string; confirmPassword: string };
+ submitButtonText?: string;
+ }) {
+ const onSubmit = params?.onSubmit ?? (() => {});
+ const initialValues = params?.initialValues;
+ const submitButtonText = params?.submitButtonText;
+
+ await render(
+
+
+
+ );
+ }
+
+ test('renders reset password form with password and confirmPassword fields', async function (assert) {
+ await renderComponent();
+ assert.dom(resetPasswordPageObject.scope).exists();
+ assert.dom('[data-test-tpk-reset-password-form-password]').exists();
+ assert
+ .dom('[data-test-tpk-reset-password-form-confirm-password]')
+ .exists();
+ assert.dom(resetPasswordPageObject.submitButton.scope).exists();
+ });
+
+ test('displays default submit button text', async function (assert) {
+ await renderComponent();
+ assert.strictEqual(
+ resetPasswordPageObject.submitButton.text,
+ 'Reset Password'
+ );
+ });
+
+ test('displays custom submit button text', async function (assert) {
+ await renderComponent({ submitButtonText: 'Réinitialiser' });
+ assert.strictEqual(
+ resetPasswordPageObject.submitButton.text,
+ 'Réinitialiser'
+ );
+ });
+
+ test('uses initial values when provided', async function (assert) {
+ await renderComponent({
+ initialValues: {
+ password: 'initialPassword',
+ confirmPassword: 'initialConfirmPassword',
+ },
+ });
+ assert.strictEqual(
+ resetPasswordPageObject.password.value,
+ 'initialPassword'
+ );
+ assert.strictEqual(
+ resetPasswordPageObject.confirmPassword.value,
+ 'initialConfirmPassword'
+ );
+ });
+
+ test('onSubmit is called with data and changeset when form is valid', async function (assert) {
+ let receivedData: unknown;
+ let receivedChangeset: ImmerChangeset | undefined;
+
+ await renderComponent({
+ onSubmit: (data, changeset) => {
+ receivedData = data;
+ receivedChangeset = changeset;
+ assert.step('onSubmit');
+ },
+ });
+
+ await resetPasswordPageObject.password.fillIn('password123');
+ await resetPasswordPageObject.confirmPassword.fillIn('password123');
+ await resetPasswordPageObject.submitButton.click();
+
+ assert.verifySteps(['onSubmit']);
+ assert.deepEqual(receivedData, {
+ password: 'password123',
+ confirmPassword: 'password123',
+ });
+ assert.ok(receivedChangeset instanceof ImmerChangeset);
+ assert.strictEqual(receivedChangeset?.get('password'), 'password123');
+ assert.strictEqual(
+ receivedChangeset?.get('confirmPassword'),
+ 'password123'
+ );
+ });
+
+ test('onSubmit is not called when form is invalid', async function (assert) {
+ await renderComponent({
+ onSubmit: () => {
+ assert.step('onSubmit');
+ },
+ });
+
+ await resetPasswordPageObject.password.fillIn('short');
+ await resetPasswordPageObject.confirmPassword.fillIn('short');
+ await resetPasswordPageObject.submitButton.click();
+
+ assert.verifySteps([]);
+ });
+
+ test('onSubmit is not called when password is empty', async function (assert) {
+ await renderComponent({
+ onSubmit: () => {
+ assert.step('onSubmit');
+ },
+ });
+
+ await resetPasswordPageObject.password.fillIn('');
+ await resetPasswordPageObject.confirmPassword.fillIn('password123');
+ await resetPasswordPageObject.submitButton.click();
+
+ assert.verifySteps([]);
+ });
+ }
+);
diff --git a/doc-app/tests/integration/components/ember-ui/prefabs/tpk-table-generic-prefab-test.gts b/doc-app/tests/integration/components/ember-ui/prefabs/tpk-table-generic-prefab-test.gts
index 51842389..619a37d3 100644
--- a/doc-app/tests/integration/components/ember-ui/prefabs/tpk-table-generic-prefab-test.gts
+++ b/doc-app/tests/integration/components/ember-ui/prefabs/tpk-table-generic-prefab-test.gts
@@ -3,7 +3,7 @@ import { setupRenderingTest } from 'ember-qunit';
import { setupIntl } from 'ember-intl/test-support';
import { click, findAll, render } from '@ember/test-helpers';
import { TableGenericUserWorker } from 'doc-app/tests/workers/table-generic';
-import { worker } from 'doc-app/tests/worker';
+import { setupMock, worker } from 'doc-app/tests/worker';
import TpkTableGenericPrefab from '@triptyk/ember-ui/components/prefabs/tpk-table-generic-prefab';
import type { TableParams } from '@triptyk/ember-ui/components/prefabs/tpk-table-generic-prefab';
import TpkSelect from '@triptyk/ember-input/components/tpk-select';
@@ -11,230 +11,266 @@ import type { TOC } from '@ember/component/template-only';
import type { TpkSelectSignature } from '@triptyk/ember-input/components/tpk-select';
import { hash } from '@ember/helper';
import { selectChoose } from 'ember-power-select/test-support';
+import stringify from 'doc-app/helpers/to-string';
-const TpkSelectElement: TOC =
+ cellValue: string;
+ };
+ }
+> =
-
-
- {{O.option}}
-
-
+
+
+ {{stringify O.option}}
+
+
;
-module('Integration | Component | Prefabs | Tpk-table-generic-prefab', function(hooks) {
- setupRenderingTest(hooks);
- setupIntl(hooks, 'fr-fr');
+module(
+ 'Integration | Component | Prefabs | Tpk-table-generic-prefab',
+ function (hooks) {
+ setupRenderingTest(hooks);
+ setupIntl(hooks, 'fr-fr');
+ setupMock(hooks);
- let tableParams:TableParams = {
+ let tableParams: TableParams = {
entity: 'user',
- pageSizes: [10,30,50,75],
+ pageSizes: [10, 30, 50, 75],
defaultSortColumn: 'firstName',
- columns:[
- {
- field: 'lastName',
- headerName: 'Nom',
- sortable: true,
- },
- {
- field: 'firstName',
- headerName: 'Prénom',
- sortable: true,
- },
- {
- field: 'email',
- headerName: 'Email',
- sortable: false,
- }],
- actionMenu: [],
- };
- hooks.beforeEach(async function () {
- await TableGenericUserWorker(worker);
- });
-
- async function renderComponent(tableParams : TableParams){
- await render(
-
-
-
- )
- }
-
- test('Render prefab table generic', async function(assert) {
- await renderComponent(tableParams)
- assert.dom('[data-test-table-generic-prefab]').exists();
- });
-
- test('It has the same number of columns as the object', async function(assert) {
- await renderComponent(tableParams)
- const columnsNumber = tableParams.columns.length;
- const columns = document.querySelectorAll('[data-test-table-generic-prefab] [data-test-row="1"] td').length;
- assert.deepEqual(columns, columnsNumber);
- })
-
- test('It passes correctly the actionMenu', async function(assert) {
- const actionMenu = [{
- icon: 'edit',
- action: () => {assert.step('rowClick function called') },
- name: 'Edit',
- },
- {
- icon: 'delete',
- action: () => {
- assert.step('delete function called');
+ columns: [
+ {
+ field: 'lastName',
+ headerName: 'Nom',
+ sortable: true,
},
- name: 'Delete',
- },]
- tableParams ={
- ...tableParams,
- actionMenu: actionMenu,}
-
- await renderComponent(tableParams)
- const deleteButtons = findAll('[data-test-actions-open-action]');
- assert.strictEqual(
- deleteButtons.length,
- 5,
- 'Correct number of delete buttons rendered',
- );
- const editButtons = findAll('[data-test-actions-open-action]');
- assert.strictEqual(
- editButtons.length,
- 5,
- 'Correct number of edit buttons rendered',
- );
- await click('[data-test-actions-open-action]');
-
- await click('[data-test-actions-menu] li:first-child button')
- assert.verifySteps(['rowClick function called']);
-
- await click('[data-test-actions-open-action]');
- await click('[data-test-actions-menu] li:last-child button');
- assert.verifySteps(['delete function called']);
- })
-
- test('it can sort by default', async function(assert) {
-
- await renderComponent(tableParams);
- assert.dom('[data-test-table-generic-prefab] [data-test-row="1"] td:nth-child(2)')?.hasText('Simon');
- });
-
- test('it passes a renderElement', async function(assert) {
- const tableParamsWithFunctions:TableParams = {
- entity: 'user',
- pageSizes: [10,30,50,75],
- defaultSortColumn: 'firstName',
- columns:[
- {
- field: 'lastName',
- headerName: 'Nom',
- renderElement: (element:unknown) => { return `Mr ${element}` },
- sortable: true,
- },
- {
- field: 'firstName',
- headerName: 'Prénom',
- sortable: true,
- },
- {
- field: 'email',
- headerName: 'Email',
- sortable:false,
- },],
+ {
+ field: 'firstName',
+ headerName: 'Prénom',
+ sortable: true,
+ },
+ {
+ field: 'email',
+ headerName: 'Email',
+ sortable: false,
+ },
+ ],
actionMenu: [],
};
- await renderComponent(tableParamsWithFunctions);
- assert.dom('[data-test-table-generic-prefab] [data-test-row="1"] td:nth-child(1)')?.hasText('Mr Leroy');
- });
-
- test('it passes a component', async function(assert) {
- const emailOptions = ['info@triptyk.eu','loempia@triptyk.eu']
- const onChange = (selection: unknown) =>{
- assert.step(selection as string);
+
+ hooks.beforeEach(async function () {
+ await TableGenericUserWorker(worker);
+ });
+
+ async function renderComponent(tableParams: TableParams) {
+ await render(
+
+
+
+ );
}
- const tableParamsWithFunctions:TableParams = {
- entity: 'user',
- pageSizes: [10,30,50,75],
- defaultSortColumn: 'firstName',
- columns:[
- {
- field: 'lastName',
- headerName: 'Nom',
- sortable: true,
- },
- {
- field: 'firstName',
- headerName: 'Prénom',
- sortable: true,
- },
- {
- field: 'email',
- headerName: 'Email',
- sortable:false,
- component : 'selectEmail',
- },],
- actionMenu: [],
- };
+ test('Render prefab table generic', async function (assert) {
+ await renderComponent(tableParams);
+ assert.dom('[data-test-table-generic-prefab]').exists();
+ });
+
+ test('It has the same number of columns as the object', async function (assert) {
+ await renderComponent(tableParams);
+ const columnsNumber = tableParams.columns.length;
+ const columns = document.querySelectorAll(
+ '[data-test-table-generic-prefab] [data-test-row="1"] td'
+ ).length;
+ assert.deepEqual(columns, columnsNumber);
+ });
+
+ test('It passes correctly the actionMenu', async function (assert) {
+ const actionMenu = [
+ {
+ icon: 'edit',
+ action: () => {
+ assert.step('rowClick function called');
+ },
+ name: 'Edit',
+ },
+ {
+ icon: 'delete',
+ action: () => {
+ assert.step('delete function called');
+ },
+ name: 'Delete',
+ },
+ ];
+ tableParams = {
+ ...tableParams,
+ actionMenu: actionMenu,
+ };
+
+ await renderComponent(tableParams);
+ const deleteButtons = findAll('[data-test-actions-open-action]');
+ assert.strictEqual(
+ deleteButtons.length,
+ 5,
+ 'Correct number of delete buttons rendered'
+ );
+ const editButtons = findAll('[data-test-actions-open-action]');
+ assert.strictEqual(
+ editButtons.length,
+ 5,
+ 'Correct number of edit buttons rendered'
+ );
+ await click('[data-test-actions-open-action]');
+
+ await click('[data-test-actions-menu] li:first-child button');
+ assert.verifySteps(['rowClick function called']);
+
+ await click('[data-test-actions-open-action]');
+ await click('[data-test-actions-menu] li:last-child button');
+ assert.verifySteps(['delete function called']);
+ });
+
+ test('it can sort by default', async function (assert) {
+ await renderComponent(tableParams);
+ assert
+ .dom('[data-test-table-generic-prefab] [data-test-row="1"]')
+ ?.hasText('Leroy Simon info@triptyk.eu');
+ });
+
+ test('it passes a renderElement', async function (assert) {
+ const tableParamsWithFunctions: TableParams = {
+ entity: 'user',
+ pageSizes: [10, 30, 50, 75],
+ defaultSortColumn: 'firstName',
+ columns: [
+ {
+ field: 'lastName',
+ headerName: 'Nom',
+ renderElement: (element: unknown) => {
+ return `Mr ${String(element)}`;
+ },
+ sortable: true,
+ },
+ {
+ field: 'firstName',
+ headerName: 'Prénom',
+ sortable: true,
+ },
+ {
+ field: 'email',
+ headerName: 'Email',
+ sortable: false,
+ },
+ ],
+ actionMenu: [],
+ };
+ await renderComponent(tableParamsWithFunctions);
+ assert
+ .dom(
+ '[data-test-table-generic-prefab] [data-test-row="1"] td:nth-child(1)'
+ )
+ ?.hasText('Mr Leroy');
+ });
+
+ test('it passes a component', async function (assert) {
+ const emailOptions = ['info@triptyk.eu', 'loempia@triptyk.eu'];
+ const onChange = (selection: unknown) => {
+ assert.step(selection as string);
+ };
+
+ const tableParamsWithFunctions: TableParams = {
+ entity: 'user',
+ pageSizes: [10, 30, 50, 75],
+ defaultSortColumn: 'firstName',
+ columns: [
+ {
+ field: 'lastName',
+ headerName: 'Nom',
+ sortable: true,
+ },
+ {
+ field: 'firstName',
+ headerName: 'Prénom',
+ sortable: true,
+ },
+ {
+ field: 'email',
+ headerName: 'Email',
+ sortable: false,
+ component: 'selectEmail',
+ },
+ ],
+ actionMenu: [],
+ };
- await render(
-
-
+
-
- )
- assert.dom('[data-test-table-generic-prefab] td:nth-child(3) [data-test-table-generic-select]').exists();
- const selectSelector = '[data-test-table-generic-prefab] td:nth-child(3) [data-test-table-generic-select] .tpk-select-trigger'
- await selectChoose(selectSelector, "loempia@triptyk.eu")
-
- assert.verifySteps(['loempia@triptyk.eu']);
- });
-
- test('it possible to click on row when rowClick was on tableParams', async function(assert) {
- const tableParamsWithFunctions:TableParams = {
- entity: 'user',
- pageSizes: [10,30,50,75],
- defaultSortColumn: 'firstName',
- rowClick: () => {
- assert.step('rowClick function called')
- },
- columns:[
- {
- field: 'lastName',
- headerName: 'Nom',
- sortable: true,
+ )
+ }}
+ />
+
+ );
+ assert
+ .dom(
+ '[data-test-table-generic-prefab] td:nth-child(3) [data-test-table-generic-select]'
+ )
+ .exists();
+ const selectSelector =
+ '[data-test-table-generic-prefab] td:nth-child(3) [data-test-table-generic-select] .tpk-select-trigger';
+ await selectChoose(selectSelector, 'loempia@triptyk.eu');
+
+ assert.verifySteps(['loempia@triptyk.eu']);
+ });
+
+ test('it possible to click on row when rowClick was on tableParams', async function (assert) {
+ const tableParamsWithFunctions: TableParams = {
+ entity: 'user',
+ pageSizes: [10, 30, 50, 75],
+ defaultSortColumn: 'firstName',
+ rowClick: () => {
+ assert.step('rowClick function called');
},
- {
- field: 'firstName',
- headerName: 'Prénom',
- sortable: true,
- }
- ],
- actionMenu: [],
- };
+ columns: [
+ {
+ field: 'lastName',
+ headerName: 'Nom',
+ sortable: true,
+ },
+ {
+ field: 'firstName',
+ headerName: 'Prénom',
+ sortable: true,
+ },
+ ],
+ actionMenu: [],
+ };
- await render(
-
-
-
- )
-
- const data = document.querySelector('[data-test-table-generic-prefab] [data-test-row="1"]') as HTMLTableElement;
- await click(data);
- assert.verifySteps(['rowClick function called']);
- })
-})
\ No newline at end of file
+ await render(
+
+
+
+ );
+
+ const data = document.querySelector(
+ '[data-test-table-generic-prefab] [data-test-row="1"]'
+ ) as HTMLTableElement;
+ await click(data);
+ assert.verifySteps(['rowClick function called']);
+ });
+ }
+);
diff --git a/doc-app/tests/integration/components/ember-ui/stack-list-test.gts b/doc-app/tests/integration/components/ember-ui/stack-list-test.gts
index 0bd95ba3..f2797a66 100644
--- a/doc-app/tests/integration/components/ember-ui/stack-list-test.gts
+++ b/doc-app/tests/integration/components/ember-ui/stack-list-test.gts
@@ -4,16 +4,15 @@ import { click, render } from '@ember/test-helpers';
import TpkStackList from '@triptyk/ember-ui/components/tpk-stack-list';
import { get } from '@ember/object';
+import stringify from 'doc-app/helpers/to-string';
const titleForAdd = 'Ajouter une donnée';
const contentData = 'machin';
-
-
-module('Integration | Component | stack-list', function ( hooks) {
+module('Integration | Component | stack-list', function (hooks) {
setupRenderingTest(hooks);
- test('adding item', async function ( assert) {
+ test('adding item', async function (assert) {
const data: unknown[] = [];
const onAddData = () => {
assert.step('onAddData');
@@ -22,20 +21,20 @@ module('Integration | Component | stack-list', function ( hooks) {
await render(
-
-
- {{get T.item 'title'}}
-
-
- {{get C.item 'title'}}
-
-
+
+
+ {{stringify (get T.item "title")}}
+
+
+ {{stringify (get C.item "title")}}
+
+
);
@@ -43,10 +42,10 @@ module('Integration | Component | stack-list', function ( hooks) {
assert.verifySteps(['onAddData']);
});
- test('toggle collapse with title', async function ( assert) {
+ test('toggle collapse with title', async function (assert) {
const data = [
{
- title: contentData,
+ title: contentData,
},
];
const titleForAdd = 'Ajouter une donnée';
@@ -59,14 +58,15 @@ module('Integration | Component | stack-list', function ( hooks) {
@data={{data}}
@onRemove={{onRemoveData}}
@onAdd={{onAddData}}
+ @readOnly={{false}}
@titleForAdd={{titleForAdd}}
as |S|
>
- {{get T.item 'title'}}
+ {{stringify (get T.item "title")}}
- {{get C.item 'title'}}
+ {{stringify (get C.item "title")}}
@@ -79,10 +79,10 @@ module('Integration | Component | stack-list', function ( hooks) {
assert.dom('[data-test-title-stackList-item]').containsText(contentData);
});
- test('deleting item', async function ( assert) {
+ test('deleting item', async function (assert) {
const data = [
{
- title: contentData,
+ title: contentData,
},
];
const onAddData = () => {};
@@ -100,10 +100,10 @@ module('Integration | Component | stack-list', function ( hooks) {
as |S|
>
- {{get T.item 'title'}}
+ {{stringify (get T.item "title")}}
- {{get C.item 'title'}}
+ {{stringify (get C.item "title")}}
diff --git a/doc-app/tests/integration/components/ember-ui/table-generic/component-test.gts b/doc-app/tests/integration/components/ember-ui/table-generic/component-test.gts
index c3bb2e9d..c9b2bcf5 100644
--- a/doc-app/tests/integration/components/ember-ui/table-generic/component-test.gts
+++ b/doc-app/tests/integration/components/ember-ui/table-generic/component-test.gts
@@ -5,6 +5,7 @@ import { setupMock, worker } from 'doc-app/tests/worker';
import { TableGenericUserWorker } from 'doc-app/tests/workers/table-generic';
import { setupRenderingTest } from 'ember-qunit';
import TpkTableGeneric from '@triptyk/ember-ui/components/tpk-table-generic';
+import stringify from 'doc-app/helpers/to-string';
module('Integration | Component | table-generic', function (hooks) {
setupRenderingTest(hooks);
@@ -17,9 +18,7 @@ module('Integration | Component | table-generic', function (hooks) {
hooks.beforeEach(async function () {
await TableGenericUserWorker(worker);
});
- async function renderTableGeneric(
- assert: Assert
- ) {
+ async function renderTableGeneric(assert: Assert) {
const rowClick = () => {
assert.step('rowClick function called');
};
@@ -27,90 +26,122 @@ module('Integration | Component | table-generic', function (hooks) {
assert.step('delete function called');
};
- await render(
-
-
-
-
-
- Prénom
-
-
- Nom
-
-
- Email
-
-
-
-
- {{element.firstName}}
-
-
- {{element.lastName}}
-
-
- {{element.email}}
-
-
-
- lustre
-
-
-
-
-
-
- );
+ await render(
+
+
+
+
+
+
+ Prénom
+
+
+ Nom
+
+
+ Email
+
+
+
+
+ {{stringify element.firstName}}
+
+
+ {{stringify element.lastName}}
+
+
+ {{stringify element.email}}
+
+
+
+ lustre
+
+
+
+
+
+
+
+ );
}
- async function renderTableGenericWithNoAction(
- assert: Assert
- ) {
+ async function renderTableGenericWithNoAction(assert: Assert) {
const rowClick = () => {
assert.step('rowClick function called');
};
- await render(
-
-
-
-
- Prénom
-
-
- Nom
-
-
- Email
-
-
-
-
- {{element.firstName}}
-
-
- {{element.lastName}}
-
-
- {{element.email}}
-
-
-
-
-
- );
+ await render(
+
+
+
+
+
+ Prénom
+
+
+ Nom
+
+
+ Email
+
+
+
+
+ {{stringify element.firstName}}
+
+
+ {{stringify element.lastName}}
+
+
+ {{stringify element.email}}
+
+
+
+
+
+
+ );
}
test('It renders search input and table', async function (assert) {
@@ -149,8 +180,8 @@ module('Integration | Component | table-generic', function (hooks) {
await fillIn('[data-test-tpk-input-input]', 'gig');
await click('[data-test-search-submit]');
-
- rows = findAll('[data-test-row]');
+
+ rows = findAll('[data-test-row]');
assert.strictEqual(rows.length, 1, 'Correct number of rows rendered');
assert.dom('tbody tr:first-child td:first-of-type').hasText('Chad');
});
@@ -161,7 +192,7 @@ module('Integration | Component | table-generic', function (hooks) {
assert.strictEqual(
deleteButton.length,
5,
- 'Correct number of delete buttons rendered',
+ 'Correct number of delete buttons rendered'
);
await click('[data-test-actions-open-action]');
await click('[data-test-delete] button');
diff --git a/doc-app/tests/pages/ember-actions-menu.ts b/doc-app/tests/pages/ember-actions-menu.ts
index dff287bd..ff29c1ae 100644
--- a/doc-app/tests/pages/ember-actions-menu.ts
+++ b/doc-app/tests/pages/ember-actions-menu.ts
@@ -18,6 +18,6 @@ export const actionMenuObject = create({
create({
trigger: clickable('button'),
isIconRendered: isPresent('img'),
- }),
+ })
),
});
diff --git a/doc-app/tests/pages/tpk-forgot-password.ts b/doc-app/tests/pages/tpk-forgot-password.ts
new file mode 100644
index 00000000..8bdf26f6
--- /dev/null
+++ b/doc-app/tests/pages/tpk-forgot-password.ts
@@ -0,0 +1,24 @@
+import {
+ clickable,
+ create,
+ fillable,
+ text,
+ value,
+} from 'ember-cli-page-object';
+
+export default create({
+ scope: '[data-test-tpk-forgot-password-form]',
+ email: create({
+ fillIn: fillable(
+ '[data-test-tpk-forgot-password-form-email] [data-test-tpk-email-input]'
+ ),
+ value: value(
+ '[data-test-tpk-forgot-password-form-email] [data-test-tpk-email-input]'
+ ),
+ }),
+ submitButton: create({
+ scope: '.tpk-forgot-password-form-button',
+ click: clickable(),
+ text: text(),
+ }),
+});
diff --git a/doc-app/tests/pages/tpk-login.ts b/doc-app/tests/pages/tpk-login.ts
new file mode 100644
index 00000000..4c592a30
--- /dev/null
+++ b/doc-app/tests/pages/tpk-login.ts
@@ -0,0 +1,32 @@
+import {
+ clickable,
+ create,
+ fillable,
+ text,
+ value,
+} from 'ember-cli-page-object';
+
+export default create({
+ scope: '[data-test-tpk-login-form]',
+ email: create({
+ fillIn: fillable(
+ '[data-test-tpk-login-form-email] [data-test-tpk-email-input]'
+ ),
+ value: value(
+ '[data-test-tpk-login-form-email] [data-test-tpk-email-input]'
+ ),
+ }),
+ password: create({
+ fillIn: fillable(
+ '[data-test-tpk-login-form-password] [data-test-tpk-password-input]'
+ ),
+ value: value(
+ '[data-test-tpk-login-form-password] [data-test-tpk-password-input]'
+ ),
+ }),
+ submitButton: create({
+ scope: '.tpk-login-form-button',
+ click: clickable(),
+ text: text(),
+ }),
+});
diff --git a/doc-app/tests/pages/tpk-reset-password.ts b/doc-app/tests/pages/tpk-reset-password.ts
new file mode 100644
index 00000000..e83fde1e
--- /dev/null
+++ b/doc-app/tests/pages/tpk-reset-password.ts
@@ -0,0 +1,32 @@
+import {
+ clickable,
+ create,
+ fillable,
+ text,
+ value,
+} from 'ember-cli-page-object';
+
+export default create({
+ scope: '[data-test-tpk-reset-password-form]',
+ password: create({
+ fillIn: fillable(
+ '[data-test-tpk-reset-password-form-password] [data-test-tpk-password-input]'
+ ),
+ value: value(
+ '[data-test-tpk-reset-password-form-password] [data-test-tpk-password-input]'
+ ),
+ }),
+ confirmPassword: create({
+ fillIn: fillable(
+ '[data-test-tpk-reset-password-form-confirm-password] [data-test-tpk-password-input]'
+ ),
+ value: value(
+ '[data-test-tpk-reset-password-form-confirm-password] [data-test-tpk-password-input]'
+ ),
+ }),
+ submitButton: create({
+ scope: '.tpk-reset-password-form-button',
+ click: clickable(),
+ text: text(),
+ }),
+});
diff --git a/doc-app/tests/test-helper.ts b/doc-app/tests/test-helper.ts
index 14e76cd8..fa5d2b13 100644
--- a/doc-app/tests/test-helper.ts
+++ b/doc-app/tests/test-helper.ts
@@ -3,18 +3,18 @@ import config from 'doc-app/config/environment';
import * as QUnit from 'qunit';
import { setApplication } from '@ember/test-helpers';
import { setup } from 'qunit-dom';
-import { start } from 'ember-qunit';
-import { setupWorker } from './worker';
+import { start as qunitStart, setupEmberOnerrorValidation } from 'ember-qunit';
import { setupGlobalA11yHooks } from 'ember-a11y-testing/test-support';
+import { setupWorker } from './worker';
-setApplication(Application.create(config.APP));
+export function start() {
+ setApplication(Application.create(config.APP));
-QUnit.begin(() => {
- setupWorker();
-});
+ setup(QUnit.assert);
+ setupEmberOnerrorValidation();
+ setupGlobalA11yHooks(() => true);
-setupGlobalA11yHooks(() => true);
-
-setup(QUnit.assert);
+ setupWorker();
-start();
+ qunitStart();
+}
diff --git a/doc-app/tests/unit/ember-input-validation/utils/clear-object-test.ts b/doc-app/tests/unit/ember-input-validation/utils/clear-object-test.ts
index a18858c0..d3c81c8e 100644
--- a/doc-app/tests/unit/ember-input-validation/utils/clear-object-test.ts
+++ b/doc-app/tests/unit/ember-input-validation/utils/clear-object-test.ts
@@ -5,7 +5,7 @@ import { setupTest } from 'ember-qunit';
module('Unit | Utils | clear-object', function (hooks) {
setupTest(hooks);
- test('Should clear values of simple object', async function (assert) {
+ test('Should clear values of simple object', function (assert) {
const objToClear = {
name: 'Romain',
age: 25,
@@ -14,13 +14,13 @@ module('Unit | Utils | clear-object', function (hooks) {
};
assert.deepEqual(clearObjectValues(objToClear), {
name: '',
- age: '',
+ age: 0,
hobbies: [],
isDeveloper: false,
});
});
- test('Should clear values of complex object', async function (assert) {
+ test('Should clear values of complex object', function (assert) {
const objToClear = {
name: 'Amaury',
age: 28,
@@ -58,7 +58,7 @@ module('Unit | Utils | clear-object', function (hooks) {
};
assert.deepEqual(clearObjectValues(objToClear), {
name: '',
- age: '',
+ age: 0,
isDeveloper: false,
hobbies: [
{
@@ -92,7 +92,7 @@ module('Unit | Utils | clear-object', function (hooks) {
},
});
});
- test('Should clear values of deepest object', async function (assert) {
+ test('Should clear values of deepest object', function (assert) {
const objToClear = {
key_1: 'value_1',
key_2: {
diff --git a/doc-app/tests/unit/ember-input-validation/utils/is-field-error-test.ts b/doc-app/tests/unit/ember-input-validation/utils/is-field-error-test.ts
index 96574933..490fa2f1 100644
--- a/doc-app/tests/unit/ember-input-validation/utils/is-field-error-test.ts
+++ b/doc-app/tests/unit/ember-input-validation/utils/is-field-error-test.ts
@@ -5,29 +5,29 @@ import { setupTest } from 'ember-qunit';
module('Unit | Utils | is-field-error', function (hooks) {
setupTest(hooks);
- test('isFieldError returns false when validation field is a prefix of the error key', async function (assert) {
+ test('isFieldError returns false when validation field is a prefix of the error key', function (assert) {
assert.false(isFieldError('subsidiary', 'subsidiaryFormationBillings'));
});
- test('isFieldError returns true when validation field is an exact match of the error key', async function (assert) {
+ test('isFieldError returns true when validation field is an exact match of the error key', function (assert) {
assert.true(isFieldError('subsidiary', 'subsidiary'));
});
- test('isFieldError returns true when validation field is a prefix of a nested error key', async function (assert) {
+ test('isFieldError returns true when validation field is a prefix of a nested error key', function (assert) {
assert.true(isFieldError('subsidiary', 'subsidiary.1.truc'));
});
- test('isFieldError returns true when validation field is a prefix of a deeply nested error key', async function (assert) {
+ test('isFieldError returns true when validation field is a prefix of a deeply nested error key', function (assert) {
assert.true(isFieldError('subsidiary.truc', 'subsidiary.truc.a.b.c'));
});
- test('isFieldError returns false when validation field is not a prefix of the error key', async function (assert) {
+ test('isFieldError returns false when validation field is not a prefix of the error key', function (assert) {
assert.false(isFieldError('subsidiary.truc', 'subsidiary.trucfle'));
});
- test('isFieldError returns true when validation field is a prefix of an array index in the error key', async function (assert) {
+ test('isFieldError returns true when validation field is a prefix of an array index in the error key', function (assert) {
assert.true(
- isFieldError('subsidiary.truc.0', 'subsidiary.truc.0.pastname'),
+ isFieldError('subsidiary.truc.0', 'subsidiary.truc.0.pastname')
);
});
});
diff --git a/doc-app/tests/unit/ember-input-validation/utils/validate-and-map-test.ts b/doc-app/tests/unit/ember-input-validation/utils/validate-and-map-test.ts
new file mode 100644
index 00000000..06000480
--- /dev/null
+++ b/doc-app/tests/unit/ember-input-validation/utils/validate-and-map-test.ts
@@ -0,0 +1,377 @@
+import { module, test } from 'qunit';
+import {
+ deepPickByPath,
+ validateAndMapErrors,
+ validateOneAndMapErrors,
+ jsonPathToDottedPath,
+ dottedPathToJsonPath,
+} from '@triptyk/ember-input-validation/utils/validate-and-map';
+import { setupTest } from 'ember-qunit';
+import { z } from 'zod';
+
+module('Unit | Utils | validate-and-map', function (hooks) {
+ setupTest(hooks);
+
+ module('deepPickByPath', function () {
+ test('it extracts a top-level string property schema', function (assert) {
+ const schema = z.object({
+ name: z.string(),
+ age: z.number(),
+ });
+
+ const result = deepPickByPath(schema, 'name');
+
+ // Validate that we get the correct schema by testing it
+ assert.strictEqual(result.parse('John'), 'John');
+ assert.throws(() => result.parse(123));
+ });
+
+ test('it extracts a nested string property schema', function (assert) {
+ const schema = z.object({
+ user: z.object({
+ name: z.string(),
+ age: z.number(),
+ }),
+ });
+
+ const result = deepPickByPath(schema, 'user.name');
+
+ // Should accept strings
+ assert.strictEqual(result.parse('Jane'), 'Jane');
+ // Should reject numbers
+ assert.throws(() => result.parse(123));
+ });
+
+ test('it extracts a deeply nested property schema', function (assert) {
+ const schema = z.object({
+ company: z.object({
+ department: z.object({
+ employee: z.object({
+ name: z.string(),
+ id: z.number(),
+ }),
+ }),
+ }),
+ });
+
+ const result = deepPickByPath(schema, 'company.department.employee.name');
+
+ assert.strictEqual(result.parse('Alice'), 'Alice');
+ assert.throws(() => result.parse(456));
+ });
+
+ test('it extracts a number property schema', function (assert) {
+ const schema = z.object({
+ user: z.object({
+ age: z.number(),
+ }),
+ });
+
+ const result = deepPickByPath(schema, 'user.age');
+
+ assert.strictEqual(result.parse(25), 25);
+ assert.throws(() => result.parse('25'));
+ });
+
+ test('it extracts an object property schema', function (assert) {
+ const schema = z.object({
+ user: z.object({
+ profile: z.object({
+ firstName: z.string(),
+ lastName: z.string(),
+ }),
+ }),
+ });
+
+ const result = deepPickByPath(schema, 'user.profile');
+
+ const validData = { firstName: 'John', lastName: 'Doe' };
+ assert.deepEqual(result.parse(validData), validData);
+ assert.throws(() => result.parse('not an object'));
+ });
+
+ test('it extracts an array property schema', function (assert) {
+ const schema = z.object({
+ users: z.array(z.string()),
+ });
+
+ const result = deepPickByPath(schema, 'users');
+
+ const validData = ['Alice', 'Bob'];
+ assert.deepEqual(result.parse(validData), validData);
+ assert.throws(() => result.parse('not an array'));
+ });
+
+ test('it throws when path does not exist in schema', function (assert) {
+ const schema = z.object({
+ name: z.string(),
+ });
+
+ assert.throws(
+ () => deepPickByPath(schema, 'nonexistent'),
+ /Key "nonexistent" not found in schema/
+ );
+ });
+
+ test('it throws when trying to traverse a non-object schema', function (assert) {
+ const schema = z.object({
+ name: z.string(),
+ });
+
+ assert.throws(
+ () => deepPickByPath(schema, 'name.something'),
+ /"something" is not an object/
+ );
+ });
+
+ test('it throws when path has a missing key in nested object', function (assert) {
+ const schema = z.object({
+ user: z.object({
+ name: z.string(),
+ }),
+ });
+
+ assert.throws(
+ () => deepPickByPath(schema, 'user.age'),
+ /Key "age" not found in schema/
+ );
+ });
+
+ test('it works with optional fields', function (assert) {
+ const schema = z.object({
+ user: z.object({
+ name: z.string().optional(),
+ }),
+ });
+
+ const result = deepPickByPath(schema, 'user.name');
+
+ assert.strictEqual(result.parse('John'), 'John');
+ assert.strictEqual(result.parse(undefined), undefined);
+ });
+ });
+
+ module('validateAndMapErrors', function () {
+ test('it returns empty array for valid data', async function (assert) {
+ const schema = z.object({
+ name: z.string(),
+ age: z.number(),
+ });
+
+ const errors = await validateAndMapErrors(schema, {
+ name: 'John',
+ age: 25,
+ });
+
+ assert.deepEqual(errors, []);
+ });
+
+ test('it returns validation errors for invalid data', async function (assert) {
+ const schema = z.object({
+ name: z.string(),
+ age: z.number(),
+ });
+
+ const errors = await validateAndMapErrors(schema, {
+ name: 'John',
+ age: 'not a number',
+ });
+
+ assert.strictEqual(errors.length, 1);
+ assert.strictEqual(errors[0]?.key, 'age');
+ assert.ok(errors[0]?.message);
+ });
+
+ test('it returns multiple validation errors', async function (assert) {
+ const schema = z.object({
+ name: z.string(),
+ age: z.number(),
+ email: z.string().email(),
+ });
+
+ const errors = await validateAndMapErrors(schema, {
+ name: 123,
+ age: 'not a number',
+ email: 'invalid-email',
+ });
+
+ assert.strictEqual(errors.length, 3);
+ const keys = errors.map((e) => e.key);
+ assert.ok(keys.includes('name'));
+ assert.ok(keys.includes('age'));
+ assert.ok(keys.includes('email'));
+ });
+
+ test('it handles nested validation errors', async function (assert) {
+ const schema = z.object({
+ user: z.object({
+ name: z.string(),
+ age: z.number(),
+ }),
+ });
+
+ const errors = await validateAndMapErrors(schema, {
+ user: {
+ name: 'John',
+ age: 'invalid',
+ },
+ });
+
+ assert.strictEqual(errors.length, 1);
+ assert.strictEqual(errors[0]?.key, 'user.age');
+ });
+ });
+
+ module('validateOneAndMapErrors', function () {
+ test('it returns empty array when single field is valid', async function (assert) {
+ const schema = z.object({
+ name: z.string(),
+ age: z.number(),
+ });
+
+ const errors = await validateOneAndMapErrors('name', schema, {
+ name: 'John',
+ age: 25,
+ });
+
+ assert.deepEqual(errors, []);
+ });
+
+ test('it returns validation error when single field is invalid', async function (assert) {
+ const schema = z.object({
+ name: z.string(),
+ age: z.number(),
+ });
+
+ const errors = await validateOneAndMapErrors('age', schema, {
+ name: 'John',
+ age: 'invalid',
+ });
+
+ assert.strictEqual(errors.length, 1);
+ assert.strictEqual(errors[0]?.key, 'age');
+ });
+
+ test('it validates nested field correctly', async function (assert) {
+ const schema = z.object({
+ user: z.object({
+ name: z.string(),
+ age: z.number(),
+ }),
+ });
+
+ const errors = await validateOneAndMapErrors('user.name', schema, {
+ user: {
+ name: 'Alice',
+ age: 30,
+ },
+ });
+
+ assert.deepEqual(errors, []);
+ });
+
+ test('it returns error for invalid nested field', async function (assert) {
+ const schema = z.object({
+ user: z.object({
+ name: z.string(),
+ age: z.number(),
+ }),
+ });
+
+ const errors = await validateOneAndMapErrors('user.age', schema, {
+ user: {
+ name: 'Alice',
+ age: 'invalid',
+ },
+ });
+
+ assert.strictEqual(errors.length, 1);
+ assert.strictEqual(errors[0]?.key, 'user.age');
+ });
+
+ test('it handles deeply nested paths', async function (assert) {
+ const schema = z.object({
+ company: z.object({
+ department: z.object({
+ employee: z.object({
+ name: z.string(),
+ }),
+ }),
+ }),
+ });
+
+ const errors = await validateOneAndMapErrors(
+ 'company.department.employee.name',
+ schema,
+ {
+ company: {
+ department: {
+ employee: {
+ name: 123,
+ },
+ },
+ },
+ }
+ );
+
+ assert.strictEqual(errors.length, 1);
+ assert.strictEqual(errors[0]?.key, 'company.department.employee.name');
+ });
+ });
+
+ module('jsonPathToDottedPath', function () {
+ test('it converts simple array notation to dot notation', function (assert) {
+ assert.strictEqual(jsonPathToDottedPath('users[0]'), 'users.0');
+ });
+
+ test('it converts nested array notation', function (assert) {
+ assert.strictEqual(
+ jsonPathToDottedPath('users[0].addresses[1]'),
+ 'users.0.addresses.1'
+ );
+ });
+
+ test('it removes quotes', function (assert) {
+ assert.strictEqual(jsonPathToDottedPath('"users"[0]'), 'users.0');
+ });
+
+ test('it handles paths without arrays', function (assert) {
+ assert.strictEqual(jsonPathToDottedPath('user.name'), 'user.name');
+ });
+
+ test('it handles complex nested paths', function (assert) {
+ assert.strictEqual(
+ jsonPathToDottedPath('company.departments[5].employees[10].name'),
+ 'company.departments.5.employees.10.name'
+ );
+ });
+ });
+
+ module('dottedPathToJsonPath', function () {
+ test('it converts dot notation to array notation', function (assert) {
+ assert.strictEqual(dottedPathToJsonPath('users.0'), 'users[0]');
+ });
+
+ test('it converts nested dot notation', function (assert) {
+ assert.strictEqual(
+ dottedPathToJsonPath('users.0.addresses.1'),
+ 'users[0].addresses[1]'
+ );
+ });
+
+ test('it removes quotes', function (assert) {
+ assert.strictEqual(dottedPathToJsonPath('"users".0'), 'users[0]');
+ });
+
+ test('it handles paths without numeric indices', function (assert) {
+ assert.strictEqual(dottedPathToJsonPath('user.name'), 'user.name');
+ });
+
+ test('it handles complex nested paths', function (assert) {
+ assert.strictEqual(
+ dottedPathToJsonPath('company.departments.5.employees.10.name'),
+ 'company.departments[5].employees[10].name'
+ );
+ });
+ });
+});
diff --git a/doc-app/tests/worker.ts b/doc-app/tests/worker.ts
index 7be1df86..8a3181ed 100644
--- a/doc-app/tests/worker.ts
+++ b/doc-app/tests/worker.ts
@@ -1,16 +1,16 @@
-/* eslint-disable no-undef */
-import { rest, setupWorker as MSWSetupWorker } from 'msw';
-import type { SetupWorker } from 'msw';
+import { http, passthrough } from 'msw';
+import { setupWorker as MSWSetupWorker } from 'msw/browser';
-
-export let worker: SetupWorker;
+export let worker: ReturnType;
export function setupWorker() {
worker = MSWSetupWorker();
}
export function stopWorker() {
- worker.printHandlers();
+ for (const handler of worker.listHandlers()) {
+ console.log('Registered handler:', handler);
+ }
worker.stop();
}
@@ -19,13 +19,13 @@ export function stopWorker() {
* The worker can be accessed using this.get('worker')
*/
export function setupMock(hooks: NestedHooks) {
- hooks.beforeEach(async function () {
+ hooks.beforeEach(function () {
worker.resetHandlers();
worker.use(
- rest.post('/write-coverage', (req) => {
+ http.post('/write-coverage', () => {
// The passthrough is for ember code coverage.
- return req.passthrough();
- }),
+ return passthrough();
+ })
);
});
diff --git a/doc-app/tests/workers/table-generic.ts b/doc-app/tests/workers/table-generic.ts
index b178a635..0ad81dfc 100644
--- a/doc-app/tests/workers/table-generic.ts
+++ b/doc-app/tests/workers/table-generic.ts
@@ -1,14 +1,21 @@
-import type { SetupWorker } from 'msw';
-import { rest } from 'msw';
+import { http } from 'msw';
import fakeData from '../integration/components/ember-ui/table-generic/data/fake-data';
+import type { setupWorker } from 'msw/browser';
-export async function TableGenericUserWorker(worker: SetupWorker) {
+export async function TableGenericUserWorker(
+ worker: ReturnType
+) {
worker.use(
- rest.get('http://localhost:4200/users', (req, res, ctx) => {
+ http.get('/users', (req) => {
let data;
- const sort = req.url.searchParams.get('sort');
- const search = req.url.searchParams.get('filter[search]');
- const pageNumber = req.url.searchParams.get('page[number]');
+
+ const sort = new URL(req.request.url).searchParams.get('sort');
+ const search = new URL(req.request.url).searchParams.get(
+ 'filter[search]'
+ );
+ const pageNumber = new URL(req.request.url).searchParams.get(
+ 'page[number]'
+ );
if (sort !== null && sort === 'firstName') {
data = fakeData.dataTestSortedReversed;
@@ -33,14 +40,11 @@ export async function TableGenericUserWorker(worker: SetupWorker) {
data = fakeData.secondPage;
}
- return res(
- ctx.status(200),
- ctx.json({
- data,
- meta: { fetched: data.length, total: 10 },
- }),
- );
- }),
+ return Response.json({
+ data,
+ meta: { fetched: data.length, total: 10 },
+ });
+ })
);
await worker.start();
}
diff --git a/doc-app/translations/ember-input-validation/prefabs/bic/en-us.yaml b/doc-app/translations/ember-input-validation/prefabs/bic/en-us.yaml
new file mode 100644
index 00000000..7ffdcb67
--- /dev/null
+++ b/doc-app/translations/ember-input-validation/prefabs/bic/en-us.yaml
@@ -0,0 +1,17 @@
+properties:
+ validationField:
+ description: 'The field name in the changeset for validation.'
+ changeset:
+ description: 'The changeset object for form validation.'
+ label:
+ description: 'The label for the input field.'
+ placeholder:
+ description: 'The placeholder text for the input field.'
+ mandatory:
+ description: 'Whether the input field is mandatory.'
+ disabled:
+ description: 'Whether the input field is disabled.'
+ onChange:
+ description: 'The action to be called when the value changes.'
+ changeEvent:
+ description: 'The event to trigger the onChange action.'
diff --git a/doc-app/translations/ember-input-validation/prefabs/bic/fr-fr.yaml b/doc-app/translations/ember-input-validation/prefabs/bic/fr-fr.yaml
new file mode 100644
index 00000000..57fbf130
--- /dev/null
+++ b/doc-app/translations/ember-input-validation/prefabs/bic/fr-fr.yaml
@@ -0,0 +1,17 @@
+properties:
+ validationField:
+ description: 'Le nom du champ dans le changeset pour la validation.'
+ changeset:
+ description: L'objet changeset pour la validation du formulaire.
+ label:
+ description: 'Le label du champ de saisie.'
+ placeholder:
+ description: 'Le texte de placeholder du champ de saisie.'
+ mandatory:
+ description: 'Indique si le champ de saisie est obligatoire.'
+ disabled:
+ description: 'Indique si le champ de saisie est désactivé.'
+ onChange:
+ description: L'action à appeler lors du changement de valeur.
+ changeEvent:
+ description: L'événement qui déclenche l'action onChange.
diff --git a/doc-app/translations/ember-input-validation/prefabs/currency/en-us.yaml b/doc-app/translations/ember-input-validation/prefabs/currency/en-us.yaml
new file mode 100644
index 00000000..b30dbab4
--- /dev/null
+++ b/doc-app/translations/ember-input-validation/prefabs/currency/en-us.yaml
@@ -0,0 +1,17 @@
+properties:
+ validationField:
+ description: 'The field name in the changeset for validation.'
+ changeset:
+ description: 'The changeset object for form validation.'
+ label:
+ description: 'The label for the input field.'
+ placeholder:
+ description: 'The placeholder text for the input field.'
+ disabled:
+ description: 'Whether the input field is disabled.'
+ mandatory:
+ description: 'Whether the input field is mandatory.'
+ onChange:
+ description: 'The action to be called when the value changes.'
+ changeEvent:
+ description: 'The event to trigger the onChange action.'
diff --git a/doc-app/translations/ember-input-validation/prefabs/currency/fr-fr.yaml b/doc-app/translations/ember-input-validation/prefabs/currency/fr-fr.yaml
new file mode 100644
index 00000000..57fbf130
--- /dev/null
+++ b/doc-app/translations/ember-input-validation/prefabs/currency/fr-fr.yaml
@@ -0,0 +1,17 @@
+properties:
+ validationField:
+ description: 'Le nom du champ dans le changeset pour la validation.'
+ changeset:
+ description: L'objet changeset pour la validation du formulaire.
+ label:
+ description: 'Le label du champ de saisie.'
+ placeholder:
+ description: 'Le texte de placeholder du champ de saisie.'
+ mandatory:
+ description: 'Indique si le champ de saisie est obligatoire.'
+ disabled:
+ description: 'Indique si le champ de saisie est désactivé.'
+ onChange:
+ description: L'action à appeler lors du changement de valeur.
+ changeEvent:
+ description: L'événement qui déclenche l'action onChange.
diff --git a/doc-app/translations/ember-input-validation/prefabs/datepicker-range/en-us.yaml b/doc-app/translations/ember-input-validation/prefabs/datepicker-range/en-us.yaml
new file mode 100644
index 00000000..58aa2dde
--- /dev/null
+++ b/doc-app/translations/ember-input-validation/prefabs/datepicker-range/en-us.yaml
@@ -0,0 +1,41 @@
+properties:
+ validationField:
+ description: 'The field name in the changeset to validate'
+ changeset:
+ description: 'The ImmerChangeset instance containing the form data'
+ multipleDatesSeparator:
+ description: 'The separator to use when multiple dates are selected. Defaults to " - "'
+ label:
+ description: 'The label text displayed above the datepicker'
+ onChange:
+ description: 'Callback function triggered when the date selection changes'
+ onClose:
+ description: 'Callback function triggered when the datepicker closes'
+ disabled:
+ description: 'Whether the datepicker is disabled'
+ mandatory:
+ description: 'Indicates if the date range selection is mandatory'
+ placeholder:
+ description: 'Placeholder text shown when no date is selected'
+ clearButton:
+ description: 'Whether to show a button to clear the selected dates'
+ todayButton:
+ description: "Whether to show a button to select today's date"
+ closeButton:
+ description: 'Whether to show a button to close the datepicker'
+ minDate:
+ description: 'The minimum selectable date'
+ maxDate:
+ description: 'The maximum selectable date'
+ keepOpen:
+ description: 'Whether to keep the datepicker open after date selection'
+ daysOfWeekDisabled:
+ description: 'An array of day numbers to disable (0-6, where 0 is Sunday)'
+ disabledDates:
+ description: 'An array of specific dates to disable'
+ viewMode:
+ description: "The initial view mode of the date picker. Can be 'clock', 'calendar', 'months', 'years', or 'decades'"
+ locale:
+ description: 'The locale to be used for date formatting'
+ dateFormat:
+ description: 'The format for displaying the selected date'
diff --git a/doc-app/translations/ember-input-validation/prefabs/datepicker-range/fr-fr.yaml b/doc-app/translations/ember-input-validation/prefabs/datepicker-range/fr-fr.yaml
new file mode 100644
index 00000000..bf89d64f
--- /dev/null
+++ b/doc-app/translations/ember-input-validation/prefabs/datepicker-range/fr-fr.yaml
@@ -0,0 +1,41 @@
+properties:
+ validationField:
+ description: 'Le nom du champ dans le changeset pour la validation.'
+ changeset:
+ description: L'objet changeset pour la validation du formulaire.
+ multipleDatesSeparator:
+ description: "Le séparateur à utiliser lorsque plusieurs dates sont sélectionnées. Par défaut ' - '."
+ label:
+ description: 'Le label du champ de saisie.'
+ onChange:
+ description: L'action à appeler lors du changement de date.
+ onClose:
+ description: L'action à appeler lors de la fermeture du datepicker.
+ disabled:
+ description: 'Indique si le champ de saisie est désactivé.'
+ mandatory:
+ description: 'Indique si la sélection de plage de dates est obligatoire.'
+ placeholder:
+ description: 'Le texte de placeholder du champ de saisie.'
+ clearButton:
+ description: 'Afficher un bouton pour effacer le champ de saisie.'
+ todayButton:
+ description: 'Afficher un bouton pour sélectionner la date du jour.'
+ closeButton:
+ description: 'Afficher un bouton pour fermer le datepicker.'
+ minDate:
+ description: 'La date minimum sélectionnable.'
+ maxDate:
+ description: 'La date maximum sélectionnable.'
+ keepOpen:
+ description: 'Garder le datepicker ouvert après la sélection.'
+ daysOfWeekDisabled:
+ description: 'Un tableau de numéros de jours à désactiver (0-6, où 0 est dimanche).'
+ disabledDates:
+ description: 'Un tableau de dates à désactiver.'
+ viewMode:
+ description: "Le mode d'affichage initial du sélecteur de date. Peut être 'clock', 'calendar', 'months', 'years', ou 'decades'."
+ locale:
+ description: 'La locale à utiliser pour le formatage de date.'
+ dateFormat:
+ description: Le format d'affichage de la date sélectionnée.
diff --git a/doc-app/translations/ember-input-validation/prefabs/datepicker/en-us.yaml b/doc-app/translations/ember-input-validation/prefabs/datepicker/en-us.yaml
new file mode 100644
index 00000000..997553cf
--- /dev/null
+++ b/doc-app/translations/ember-input-validation/prefabs/datepicker/en-us.yaml
@@ -0,0 +1,57 @@
+properties:
+ validationField:
+ description: 'The field name in the changeset for validation.'
+ changeset:
+ description: 'The changeset object for form validation.'
+ multipleDatesSeparator:
+ description: "The separator to use when multiple dates are selected. Defaults to ' - '."
+ label:
+ description: 'The label for the input field.'
+ onChange:
+ description: 'The action to be called when the date changes.'
+ onClose:
+ description: 'The action to be called when the datepicker closes.'
+ disabled:
+ description: 'Whether the input field is disabled.'
+ mandatory:
+ description: 'To indicate if input is mandatory.'
+ placeholder:
+ description: 'The placeholder text for the input field.'
+ clearButton:
+ description: 'Whether to show a button to clear the input field.'
+ todayButton:
+ description: "Whether to show a button to select today's date."
+ closeButton:
+ description: 'Whether to show a button to close the datepicker.'
+ minDate:
+ description: 'The minimum selectable date.'
+ maxDate:
+ description: 'The maximum selectable date.'
+ keepOpen:
+ description: 'Whether to keep the datepicker open after selection.'
+ daysOfWeekDisabled:
+ description: 'An array of day numbers to disable (0-6, where 0 is Sunday).'
+ disabledDates:
+ description: 'An array of dates to disable.'
+ viewMode:
+ description: "The initial view mode of the date picker. Can be 'clock', 'calendar', 'months', 'years', or 'decades'."
+ locale:
+ description: 'The locale to be used for date formatting.'
+ dateFormat:
+ description: 'The format for displaying the selected date.'
+ promptTimeOnDateChange:
+ description: 'Whether to prompt the time when the date changes.'
+ noCalendar:
+ description: 'Whether to hide the calendar.'
+ enableTime:
+ description: 'Whether to show the time picker.'
+ stepping:
+ description: 'The stepping of the time picker.'
+ enableSecond:
+ description: 'Whether to show the second picker.'
+ disabledTimeIntervals:
+ description: 'An array of time intervals to disable.'
+ disabledHours:
+ description: 'An array of hours to disable.'
+ enabledHours:
+ description: 'An array of hours to enable.'
diff --git a/doc-app/translations/ember-input-validation/prefabs/datepicker/fr-fr.yaml b/doc-app/translations/ember-input-validation/prefabs/datepicker/fr-fr.yaml
new file mode 100644
index 00000000..d07f439f
--- /dev/null
+++ b/doc-app/translations/ember-input-validation/prefabs/datepicker/fr-fr.yaml
@@ -0,0 +1,57 @@
+properties:
+ validationField:
+ description: 'Le nom du champ dans le changeset pour la validation.'
+ changeset:
+ description: L'objet changeset pour la validation du formulaire.
+ multipleDatesSeparator:
+ description: "Le séparateur à utiliser lorsque plusieurs dates sont sélectionnées. Par défaut ' - '."
+ label:
+ description: 'Le label du champ de saisie.'
+ onChange:
+ description: L'action à appeler lors du changement de date.
+ onClose:
+ description: L'action à appeler lors de la fermeture du datepicker.
+ disabled:
+ description: 'Indique si le champ de saisie est désactivé.'
+ mandatory:
+ description: 'Pour indiquer si le champ est obligatoire.'
+ placeholder:
+ description: 'Le texte de placeholder du champ de saisie.'
+ clearButton:
+ description: 'Afficher un bouton pour effacer le champ de saisie.'
+ todayButton:
+ description: 'Afficher un bouton pour sélectionner la date du jour.'
+ closeButton:
+ description: 'Afficher un bouton pour fermer le datepicker.'
+ minDate:
+ description: 'La date minimum sélectionnable.'
+ maxDate:
+ description: 'La date maximum sélectionnable.'
+ keepOpen:
+ description: 'Garder le datepicker ouvert après la sélection.'
+ daysOfWeekDisabled:
+ description: 'Un tableau de numéros de jours à désactiver (0-6, où 0 est dimanche).'
+ disabledDates:
+ description: 'Un tableau de dates à désactiver.'
+ viewMode:
+ description: "Le mode d'affichage initial du sélecteur de date. Peut être 'clock', 'calendar', 'months', 'years', ou 'decades'."
+ locale:
+ description: 'La locale à utiliser pour le formatage de date.'
+ dateFormat:
+ description: Le format d'affichage de la date sélectionnée.
+ promptTimeOnDateChange:
+ description: Demander l'heure lors du changement de date.
+ noCalendar:
+ description: 'Masquer le calendrier.'
+ enableTime:
+ description: Afficher le sélecteur d'heure.
+ stepping:
+ description: L'incrément du sélecteur d'heure.
+ enableSecond:
+ description: 'Afficher le sélecteur de secondes.'
+ disabledTimeIntervals:
+ description: Un tableau d'intervalles de temps à désactiver.
+ disabledHours:
+ description: Un tableau d'heures à désactiver.
+ enabledHours:
+ description: Un tableau d'heures à activer.
diff --git a/doc-app/translations/ember-input-validation/prefabs/email/en-us.yaml b/doc-app/translations/ember-input-validation/prefabs/email/en-us.yaml
new file mode 100644
index 00000000..5a79c3f2
--- /dev/null
+++ b/doc-app/translations/ember-input-validation/prefabs/email/en-us.yaml
@@ -0,0 +1,17 @@
+properties:
+ validationField:
+ description: 'The field name in the changeset for validation'
+ changeset:
+ description: 'The changeset object for form validation'
+ label:
+ description: 'The label for the input field'
+ placeholder:
+ description: 'Placeholder text shown in the input field when empty'
+ disabled:
+ description: 'Whether the input field is disabled'
+ mandatory:
+ description: 'Whether the input field is mandatory'
+ onChange:
+ description: 'The action to be called when the input value changes'
+ changeEvent:
+ description: 'The event to trigger the onChange action'
diff --git a/doc-app/translations/ember-input-validation/prefabs/email/fr-fr.yaml b/doc-app/translations/ember-input-validation/prefabs/email/fr-fr.yaml
new file mode 100644
index 00000000..57fbf130
--- /dev/null
+++ b/doc-app/translations/ember-input-validation/prefabs/email/fr-fr.yaml
@@ -0,0 +1,17 @@
+properties:
+ validationField:
+ description: 'Le nom du champ dans le changeset pour la validation.'
+ changeset:
+ description: L'objet changeset pour la validation du formulaire.
+ label:
+ description: 'Le label du champ de saisie.'
+ placeholder:
+ description: 'Le texte de placeholder du champ de saisie.'
+ mandatory:
+ description: 'Indique si le champ de saisie est obligatoire.'
+ disabled:
+ description: 'Indique si le champ de saisie est désactivé.'
+ onChange:
+ description: L'action à appeler lors du changement de valeur.
+ changeEvent:
+ description: L'événement qui déclenche l'action onChange.
diff --git a/doc-app/translations/ember-input-validation/prefabs/file-list/en-us.yaml b/doc-app/translations/ember-input-validation/prefabs/file-list/en-us.yaml
new file mode 100644
index 00000000..6a9ca5c4
--- /dev/null
+++ b/doc-app/translations/ember-input-validation/prefabs/file-list/en-us.yaml
@@ -0,0 +1,17 @@
+properties:
+ validationField:
+ description: 'The field name in the changeset for validation'
+ changeset:
+ description: 'The changeset object for form validation'
+ label:
+ description: 'The label for the input field'
+ placeholder:
+ description: 'Placeholder text shown in the dropzone area'
+ disabled:
+ description: 'Whether the input field is disabled'
+ mandatory:
+ description: 'Whether the file upload field is mandatory'
+ onChange:
+ description: 'The action to be called when the file selection changes'
+ disableDownload:
+ description: 'Whether the download button is disabled'
diff --git a/doc-app/translations/ember-input-validation/prefabs/file-list/fr-fr.yaml b/doc-app/translations/ember-input-validation/prefabs/file-list/fr-fr.yaml
new file mode 100644
index 00000000..51b759da
--- /dev/null
+++ b/doc-app/translations/ember-input-validation/prefabs/file-list/fr-fr.yaml
@@ -0,0 +1,19 @@
+properties:
+ validationField:
+ description: 'Le nom du champ dans le changeset pour la validation.'
+ changeset:
+ description: L'objet changeset pour la validation du formulaire.
+ label:
+ description: 'Le label du champ de saisie.'
+ placeholder:
+ description: 'Le texte de placeholder du champ de saisie.'
+ mandatory:
+ description: 'Indique si le champ de saisie est obligatoire.'
+ disabled:
+ description: 'Indique si le champ de saisie est désactivé.'
+ onChange:
+ description: L'action à appeler lors du changement de valeur.
+ accept:
+ description: 'Les types de fichiers acceptés.'
+ multiple:
+ description: 'Autoriser la sélection de plusieurs fichiers.'
diff --git a/doc-app/translations/ember-input-validation/prefabs/file/en-us.yaml b/doc-app/translations/ember-input-validation/prefabs/file/en-us.yaml
new file mode 100644
index 00000000..b83c2833
--- /dev/null
+++ b/doc-app/translations/ember-input-validation/prefabs/file/en-us.yaml
@@ -0,0 +1,15 @@
+properties:
+ validationField:
+ description: 'The field name in the changeset for validation'
+ changeset:
+ description: 'The changeset object for form validation'
+ label:
+ description: 'The label for the input field'
+ disabled:
+ description: 'Whether the input field is disabled'
+ mandatory:
+ description: 'Whether the file field is mandatory'
+ onChange:
+ description: 'The action to be called when the file selection changes'
+ changeEvent:
+ description: 'The event to trigger the onChange action'
diff --git a/doc-app/translations/ember-input-validation/prefabs/file/fr-fr.yaml b/doc-app/translations/ember-input-validation/prefabs/file/fr-fr.yaml
new file mode 100644
index 00000000..7fb6525c
--- /dev/null
+++ b/doc-app/translations/ember-input-validation/prefabs/file/fr-fr.yaml
@@ -0,0 +1,17 @@
+properties:
+ validationField:
+ description: 'Le nom du champ dans le changeset pour la validation.'
+ changeset:
+ description: L'objet changeset pour la validation du formulaire.
+ label:
+ description: 'Le label du champ de saisie.'
+ placeholder:
+ description: 'Le texte de placeholder du champ de saisie.'
+ mandatory:
+ description: 'Indique si le champ de saisie est obligatoire.'
+ disabled:
+ description: 'Indique si le champ de saisie est désactivé.'
+ onChange:
+ description: L'action à appeler lors du changement de valeur.
+ accept:
+ description: 'Les types de fichiers acceptés.'
diff --git a/doc-app/translations/ember-input-validation/prefabs/iban/en-us.yaml b/doc-app/translations/ember-input-validation/prefabs/iban/en-us.yaml
new file mode 100644
index 00000000..aa88e4c3
--- /dev/null
+++ b/doc-app/translations/ember-input-validation/prefabs/iban/en-us.yaml
@@ -0,0 +1,17 @@
+properties:
+ validationField:
+ description: 'The field name in the changeset for validation'
+ changeset:
+ description: 'The changeset object for form validation'
+ label:
+ description: 'The label for the input field'
+ placeholder:
+ description: 'Placeholder text shown in the input field when empty'
+ disabled:
+ description: 'Whether the input field is disabled'
+ mandatory:
+ description: 'Whether the IBAN field is mandatory'
+ onChange:
+ description: 'The action to be called when the input value changes'
+ changeEvent:
+ description: 'The event to trigger the onChange action'
diff --git a/doc-app/translations/ember-input-validation/prefabs/iban/fr-fr.yaml b/doc-app/translations/ember-input-validation/prefabs/iban/fr-fr.yaml
new file mode 100644
index 00000000..57fbf130
--- /dev/null
+++ b/doc-app/translations/ember-input-validation/prefabs/iban/fr-fr.yaml
@@ -0,0 +1,17 @@
+properties:
+ validationField:
+ description: 'Le nom du champ dans le changeset pour la validation.'
+ changeset:
+ description: L'objet changeset pour la validation du formulaire.
+ label:
+ description: 'Le label du champ de saisie.'
+ placeholder:
+ description: 'Le texte de placeholder du champ de saisie.'
+ mandatory:
+ description: 'Indique si le champ de saisie est obligatoire.'
+ disabled:
+ description: 'Indique si le champ de saisie est désactivé.'
+ onChange:
+ description: L'action à appeler lors du changement de valeur.
+ changeEvent:
+ description: L'événement qui déclenche l'action onChange.
diff --git a/doc-app/translations/ember-input-validation/prefabs/input/en-us.yaml b/doc-app/translations/ember-input-validation/prefabs/input/en-us.yaml
new file mode 100644
index 00000000..64ed6023
--- /dev/null
+++ b/doc-app/translations/ember-input-validation/prefabs/input/en-us.yaml
@@ -0,0 +1,25 @@
+properties:
+ validationField:
+ description: 'The field name in the changeset for validation.'
+ changeset:
+ description: 'The changeset object for form validation.'
+ label:
+ description: 'The label for the input field.'
+ placeholder:
+ description: 'The placeholder text for the input field.'
+ type:
+ description: "The type of the input field. Defaults to 'text'."
+ mandatory:
+ description: 'Whether the input field is mandatory.'
+ mask:
+ description: 'The mask to apply to the input field.'
+ maskOptions:
+ description: 'The options to apply to the mask.'
+ unmaskValue:
+ description: 'Whether to unmask the value before setting it in the changeset.'
+ disabled:
+ description: 'Whether the input field is disabled.'
+ onChange:
+ description: 'The action to be called when the value changes.'
+ changeEvent:
+ description: 'The event to trigger the onChange action.'
diff --git a/doc-app/translations/ember-input-validation/prefabs/input/fr-fr.yaml b/doc-app/translations/ember-input-validation/prefabs/input/fr-fr.yaml
new file mode 100644
index 00000000..57fbf130
--- /dev/null
+++ b/doc-app/translations/ember-input-validation/prefabs/input/fr-fr.yaml
@@ -0,0 +1,17 @@
+properties:
+ validationField:
+ description: 'Le nom du champ dans le changeset pour la validation.'
+ changeset:
+ description: L'objet changeset pour la validation du formulaire.
+ label:
+ description: 'Le label du champ de saisie.'
+ placeholder:
+ description: 'Le texte de placeholder du champ de saisie.'
+ mandatory:
+ description: 'Indique si le champ de saisie est obligatoire.'
+ disabled:
+ description: 'Indique si le champ de saisie est désactivé.'
+ onChange:
+ description: L'action à appeler lors du changement de valeur.
+ changeEvent:
+ description: L'événement qui déclenche l'action onChange.
diff --git a/doc-app/translations/ember-input-validation/prefabs/integer/en-us.yaml b/doc-app/translations/ember-input-validation/prefabs/integer/en-us.yaml
new file mode 100644
index 00000000..a0191dc5
--- /dev/null
+++ b/doc-app/translations/ember-input-validation/prefabs/integer/en-us.yaml
@@ -0,0 +1,19 @@
+properties:
+ validationField:
+ description: 'The field name in the changeset for validation'
+ changeset:
+ description: 'The changeset object for form validation'
+ label:
+ description: 'The label for the input field'
+ placeholder:
+ description: 'Placeholder text shown in the input field when empty'
+ disabled:
+ description: 'Whether the input field is disabled'
+ mandatory:
+ description: 'Whether the integer field is mandatory'
+ onChange:
+ description: 'The action to be called when the input value changes'
+ changeEvent:
+ description: 'The event to trigger the onChange action'
+ unsigned:
+ description: 'Whether to restrict the input to unsigned integers (minimum 0), preventing negative numbers'
diff --git a/doc-app/translations/ember-input-validation/prefabs/integer/fr-fr.yaml b/doc-app/translations/ember-input-validation/prefabs/integer/fr-fr.yaml
new file mode 100644
index 00000000..57fbf130
--- /dev/null
+++ b/doc-app/translations/ember-input-validation/prefabs/integer/fr-fr.yaml
@@ -0,0 +1,17 @@
+properties:
+ validationField:
+ description: 'Le nom du champ dans le changeset pour la validation.'
+ changeset:
+ description: L'objet changeset pour la validation du formulaire.
+ label:
+ description: 'Le label du champ de saisie.'
+ placeholder:
+ description: 'Le texte de placeholder du champ de saisie.'
+ mandatory:
+ description: 'Indique si le champ de saisie est obligatoire.'
+ disabled:
+ description: 'Indique si le champ de saisie est désactivé.'
+ onChange:
+ description: L'action à appeler lors du changement de valeur.
+ changeEvent:
+ description: L'événement qui déclenche l'action onChange.
diff --git a/doc-app/translations/ember-input-validation/prefabs/mobile/en-us.yaml b/doc-app/translations/ember-input-validation/prefabs/mobile/en-us.yaml
new file mode 100644
index 00000000..7ffdcb67
--- /dev/null
+++ b/doc-app/translations/ember-input-validation/prefabs/mobile/en-us.yaml
@@ -0,0 +1,17 @@
+properties:
+ validationField:
+ description: 'The field name in the changeset for validation.'
+ changeset:
+ description: 'The changeset object for form validation.'
+ label:
+ description: 'The label for the input field.'
+ placeholder:
+ description: 'The placeholder text for the input field.'
+ mandatory:
+ description: 'Whether the input field is mandatory.'
+ disabled:
+ description: 'Whether the input field is disabled.'
+ onChange:
+ description: 'The action to be called when the value changes.'
+ changeEvent:
+ description: 'The event to trigger the onChange action.'
diff --git a/doc-app/translations/ember-input-validation/prefabs/mobile/fr-fr.yaml b/doc-app/translations/ember-input-validation/prefabs/mobile/fr-fr.yaml
new file mode 100644
index 00000000..57fbf130
--- /dev/null
+++ b/doc-app/translations/ember-input-validation/prefabs/mobile/fr-fr.yaml
@@ -0,0 +1,17 @@
+properties:
+ validationField:
+ description: 'Le nom du champ dans le changeset pour la validation.'
+ changeset:
+ description: L'objet changeset pour la validation du formulaire.
+ label:
+ description: 'Le label du champ de saisie.'
+ placeholder:
+ description: 'Le texte de placeholder du champ de saisie.'
+ mandatory:
+ description: 'Indique si le champ de saisie est obligatoire.'
+ disabled:
+ description: 'Indique si le champ de saisie est désactivé.'
+ onChange:
+ description: L'action à appeler lors du changement de valeur.
+ changeEvent:
+ description: L'événement qui déclenche l'action onChange.
diff --git a/doc-app/translations/ember-input-validation/prefabs/national-number/en-us.yaml b/doc-app/translations/ember-input-validation/prefabs/national-number/en-us.yaml
new file mode 100644
index 00000000..7ffdcb67
--- /dev/null
+++ b/doc-app/translations/ember-input-validation/prefabs/national-number/en-us.yaml
@@ -0,0 +1,17 @@
+properties:
+ validationField:
+ description: 'The field name in the changeset for validation.'
+ changeset:
+ description: 'The changeset object for form validation.'
+ label:
+ description: 'The label for the input field.'
+ placeholder:
+ description: 'The placeholder text for the input field.'
+ mandatory:
+ description: 'Whether the input field is mandatory.'
+ disabled:
+ description: 'Whether the input field is disabled.'
+ onChange:
+ description: 'The action to be called when the value changes.'
+ changeEvent:
+ description: 'The event to trigger the onChange action.'
diff --git a/doc-app/translations/ember-input-validation/prefabs/national-number/fr-fr.yaml b/doc-app/translations/ember-input-validation/prefabs/national-number/fr-fr.yaml
new file mode 100644
index 00000000..57fbf130
--- /dev/null
+++ b/doc-app/translations/ember-input-validation/prefabs/national-number/fr-fr.yaml
@@ -0,0 +1,17 @@
+properties:
+ validationField:
+ description: 'Le nom du champ dans le changeset pour la validation.'
+ changeset:
+ description: L'objet changeset pour la validation du formulaire.
+ label:
+ description: 'Le label du champ de saisie.'
+ placeholder:
+ description: 'Le texte de placeholder du champ de saisie.'
+ mandatory:
+ description: 'Indique si le champ de saisie est obligatoire.'
+ disabled:
+ description: 'Indique si le champ de saisie est désactivé.'
+ onChange:
+ description: L'action à appeler lors du changement de valeur.
+ changeEvent:
+ description: L'événement qui déclenche l'action onChange.
diff --git a/doc-app/translations/ember-input-validation/prefabs/number/en-us.yaml b/doc-app/translations/ember-input-validation/prefabs/number/en-us.yaml
new file mode 100644
index 00000000..4cf5ce36
--- /dev/null
+++ b/doc-app/translations/ember-input-validation/prefabs/number/en-us.yaml
@@ -0,0 +1,25 @@
+properties:
+ validationField:
+ description: 'The field name in the changeset for validation.'
+ changeset:
+ description: 'The changeset object for form validation.'
+ label:
+ description: 'The label for the input field.'
+ placeholder:
+ description: 'The placeholder text for the input field.'
+ unsigned:
+ description: 'Whether the number input should only accept positive values (minimum 0).'
+ min:
+ description: 'The minimum value for the number input.'
+ step:
+ description: 'The step increment for the number input.'
+ mandatory:
+ description: 'Whether the input field is mandatory.'
+ disabled:
+ description: 'Whether the input field is disabled.'
+ onChange:
+ description: 'The action to be called when the value changes.'
+ changeEvent:
+ description: 'The event to trigger the onChange action.'
+ requiredFields:
+ description: 'Array of required field names for validation.'
diff --git a/doc-app/translations/ember-input-validation/prefabs/number/fr-fr.yaml b/doc-app/translations/ember-input-validation/prefabs/number/fr-fr.yaml
new file mode 100644
index 00000000..61d6ba95
--- /dev/null
+++ b/doc-app/translations/ember-input-validation/prefabs/number/fr-fr.yaml
@@ -0,0 +1,19 @@
+properties:
+ validationField:
+ description: 'Le nom du champ dans le changeset pour la validation.'
+ changeset:
+ description: L'objet changeset pour la validation du formulaire.
+ label:
+ description: 'Le label du champ de saisie.'
+ placeholder:
+ description: 'Le texte de placeholder du champ de saisie.'
+ mandatory:
+ description: 'Indique si le champ de saisie est obligatoire.'
+ disabled:
+ description: 'Indique si le champ de saisie est désactivé.'
+ onChange:
+ description: L'action à appeler lors du changement de valeur.
+ changeEvent:
+ description: L'événement qui déclenche l'action onChange.
+ numberOptions:
+ description: 'Les options pour le champ de nombre.'
diff --git a/doc-app/translations/ember-input-validation/prefabs/password/en-us.yaml b/doc-app/translations/ember-input-validation/prefabs/password/en-us.yaml
new file mode 100644
index 00000000..7ffdcb67
--- /dev/null
+++ b/doc-app/translations/ember-input-validation/prefabs/password/en-us.yaml
@@ -0,0 +1,17 @@
+properties:
+ validationField:
+ description: 'The field name in the changeset for validation.'
+ changeset:
+ description: 'The changeset object for form validation.'
+ label:
+ description: 'The label for the input field.'
+ placeholder:
+ description: 'The placeholder text for the input field.'
+ mandatory:
+ description: 'Whether the input field is mandatory.'
+ disabled:
+ description: 'Whether the input field is disabled.'
+ onChange:
+ description: 'The action to be called when the value changes.'
+ changeEvent:
+ description: 'The event to trigger the onChange action.'
diff --git a/doc-app/translations/ember-input-validation/prefabs/password/fr-fr.yaml b/doc-app/translations/ember-input-validation/prefabs/password/fr-fr.yaml
new file mode 100644
index 00000000..57fbf130
--- /dev/null
+++ b/doc-app/translations/ember-input-validation/prefabs/password/fr-fr.yaml
@@ -0,0 +1,17 @@
+properties:
+ validationField:
+ description: 'Le nom du champ dans le changeset pour la validation.'
+ changeset:
+ description: L'objet changeset pour la validation du formulaire.
+ label:
+ description: 'Le label du champ de saisie.'
+ placeholder:
+ description: 'Le texte de placeholder du champ de saisie.'
+ mandatory:
+ description: 'Indique si le champ de saisie est obligatoire.'
+ disabled:
+ description: 'Indique si le champ de saisie est désactivé.'
+ onChange:
+ description: L'action à appeler lors du changement de valeur.
+ changeEvent:
+ description: L'événement qui déclenche l'action onChange.
diff --git a/doc-app/translations/ember-input-validation/prefabs/radio-group/en-us.yaml b/doc-app/translations/ember-input-validation/prefabs/radio-group/en-us.yaml
new file mode 100644
index 00000000..86ada1a7
--- /dev/null
+++ b/doc-app/translations/ember-input-validation/prefabs/radio-group/en-us.yaml
@@ -0,0 +1,17 @@
+properties:
+ validationField:
+ description: 'The field name in the changeset for validation.'
+ changeset:
+ description: 'The changeset object for form validation.'
+ value:
+ description: 'Value to pass to the changeset if the radio option is selected.'
+ groupLabel:
+ description: 'The label for the radio button group.'
+ mandatory:
+ description: 'Whether the radio group selection is mandatory.'
+ disabled:
+ description: 'Whether the radio group is disabled.'
+ classless:
+ description: 'Whether to apply default CSS classes to the component.'
+ onChange:
+ description: 'The action to be called when the selection changes.'
diff --git a/doc-app/translations/ember-input-validation/prefabs/radio-group/fr-fr.yaml b/doc-app/translations/ember-input-validation/prefabs/radio-group/fr-fr.yaml
new file mode 100644
index 00000000..99f09d83
--- /dev/null
+++ b/doc-app/translations/ember-input-validation/prefabs/radio-group/fr-fr.yaml
@@ -0,0 +1,15 @@
+properties:
+ validationField:
+ description: 'Le nom du champ dans le changeset pour la validation.'
+ changeset:
+ description: L'objet changeset pour la validation du formulaire.
+ label:
+ description: 'Le label du groupe de boutons radio.'
+ disabled:
+ description: 'Indique si le groupe de boutons radio est désactivé.'
+ onChange:
+ description: L'action à appeler lors du changement de valeur.
+ options:
+ description: 'Les options pour le groupe de boutons radio.'
+ mandatory:
+ description: 'Indique si le champ de saisie est obligatoire.'
diff --git a/doc-app/translations/ember-input-validation/prefabs/radio/en-us.yaml b/doc-app/translations/ember-input-validation/prefabs/radio/en-us.yaml
new file mode 100644
index 00000000..82eea6da
--- /dev/null
+++ b/doc-app/translations/ember-input-validation/prefabs/radio/en-us.yaml
@@ -0,0 +1,17 @@
+properties:
+ validationField:
+ description: 'The field name in the changeset for validation.'
+ changeset:
+ description: 'The changeset object for form validation.'
+ value:
+ description: 'Value to pass to the changeset if the radio button is selected.'
+ label:
+ description: 'The label for the radio button.'
+ mandatory:
+ description: 'Whether the radio button selection is mandatory.'
+ disabled:
+ description: 'Whether the radio button is disabled.'
+ classless:
+ description: 'Whether to apply default CSS classes to the component.'
+ onChange:
+ description: 'The action to be called when the selection changes.'
diff --git a/doc-app/translations/ember-input-validation/prefabs/radio/fr-fr.yaml b/doc-app/translations/ember-input-validation/prefabs/radio/fr-fr.yaml
new file mode 100644
index 00000000..4422f894
--- /dev/null
+++ b/doc-app/translations/ember-input-validation/prefabs/radio/fr-fr.yaml
@@ -0,0 +1,15 @@
+properties:
+ validationField:
+ description: 'Le nom du champ dans le changeset pour la validation.'
+ changeset:
+ description: L'objet changeset pour la validation du formulaire.
+ label:
+ description: 'Le label du champ radio.'
+ disabled:
+ description: 'Indique si le bouton radio est désactivé.'
+ onChange:
+ description: L'action à appeler lors du changement de valeur.
+ value:
+ description: 'La valeur du bouton radio.'
+ mandatory:
+ description: 'Indique si le champ de saisie est obligatoire.'
diff --git a/doc-app/translations/ember-input-validation/prefabs/select-create/en-us.yaml b/doc-app/translations/ember-input-validation/prefabs/select-create/en-us.yaml
new file mode 100644
index 00000000..77151579
--- /dev/null
+++ b/doc-app/translations/ember-input-validation/prefabs/select-create/en-us.yaml
@@ -0,0 +1,45 @@
+properties:
+ validationField:
+ description: 'The field name in the changeset for validation.'
+ changeset:
+ description: 'The changeset object for form validation.'
+ options:
+ description: 'The options to display in the select dropdown. Each option should have a toString() method.'
+ onCreate:
+ description: 'The action to be called when user creates a new value. Should return the newly created option object.'
+ label:
+ description: 'The label for the select field.'
+ placeholder:
+ description: 'The placeholder text for the select field.'
+ disabled:
+ description: 'Whether the select field is disabled.'
+ multiple:
+ description: 'Whether multiple selections are allowed.'
+ initiallyOpened:
+ description: 'Whether the select dropdown is initially opened.'
+ allowClear:
+ description: 'Whether to show a button to clear the selection.'
+ mandatory:
+ description: 'Whether the select field is mandatory.'
+ onChange:
+ description: 'The action to be called when the selection changes.'
+ labelComponent:
+ description: 'The custom component to use for the label.'
+ selectedItemComponent:
+ description: 'The custom component to use for the selected item.'
+ placeholderComponent:
+ description: 'The custom component to use for the placeholder.'
+ onSearch:
+ description: 'The action to be called when user types in the search input.'
+ searchPlaceholder:
+ description: 'The placeholder text for the search input.'
+ searchMessage:
+ description: 'Message shown in options list when no search has been entered and there are no options.'
+ loadingMessage:
+ description: 'Message shown in options list when loading options.'
+ noMatchesMessage:
+ description: 'Message shown in options list when no matches are found.'
+ showCreateWhen:
+ description: 'The action to be called to determine if the create option should be shown.'
+ buildSuggestion:
+ description: 'The action to be called to build the suggestion label for the create option.'
diff --git a/doc-app/translations/ember-input-validation/prefabs/select-create/fr-fr.yaml b/doc-app/translations/ember-input-validation/prefabs/select-create/fr-fr.yaml
new file mode 100644
index 00000000..86be3056
--- /dev/null
+++ b/doc-app/translations/ember-input-validation/prefabs/select-create/fr-fr.yaml
@@ -0,0 +1,45 @@
+properties:
+ validationField:
+ description: 'Le nom du champ dans le changeset pour la validation.'
+ changeset:
+ description: L'objet changeset pour la validation du formulaire.
+ label:
+ description: 'Le label du champ de sélection.'
+ placeholder:
+ description: 'Le texte de placeholder du champ de sélection.'
+ mandatory:
+ description: 'Indique si le champ de sélection est obligatoire.'
+ disabled:
+ description: 'Indique si le champ de sélection est désactivé.'
+ onChange:
+ description: L'action à appeler lors du changement de valeur.
+ options:
+ description: 'Les options disponibles pour la sélection.'
+ renderInPlace:
+ description: Afficher le dropdown à la place au lieu d'utiliser ember-wormhole.
+ allowClear:
+ description: 'Afficher un bouton pour effacer la sélection.'
+ searchEnabled:
+ description: 'Activer la recherche dans les options.'
+ searchField:
+ description: 'Le champ à utiliser pour la recherche.'
+ selected:
+ description: 'La valeur sélectionnée.'
+ loadingMessage:
+ description: 'Le message à afficher lors du chargement.'
+ noMatchesMessage:
+ description: Le message à afficher lorsqu'aucune option ne correspond.
+ onCreate:
+ description: L'action à appeler lors de la création d'une nouvelle option.
+ showCreateWhen:
+ description: Une fonction qui détermine quand afficher l'option de création.
+ showCreatePosition:
+ description: La position où afficher l'option de création (top ou bottom).
+ buildSuggestion:
+ description: Une fonction pour construire la suggestion d'option de création.
+ suggestForBlacklist:
+ description: Suggérer la création même si l'option est dans la liste noire.
+ suggestForEmptySearch:
+ description: 'Suggérer la création même si la recherche est vide.'
+ blacklistedOptions:
+ description: 'Les options qui ne doivent pas déclencher la suggestion de création.'
diff --git a/doc-app/translations/ember-input-validation/prefabs/select-search/en-us.yaml b/doc-app/translations/ember-input-validation/prefabs/select-search/en-us.yaml
new file mode 100644
index 00000000..d8eb9227
--- /dev/null
+++ b/doc-app/translations/ember-input-validation/prefabs/select-search/en-us.yaml
@@ -0,0 +1,39 @@
+properties:
+ validationField:
+ description: 'The field name in the changeset to validate'
+ changeset:
+ description: 'The changeset instance containing the form data and validation logic'
+ options:
+ description: 'An array of selectable options that will be displayed in the dropdown. Each option should have a toString() method for display'
+ onSearch:
+ description: 'A function or ember-concurrency task that handles search logic. Receives the search term as a parameter and should return filtered options. Use with (perform this.onSearch) when using tasks'
+ label:
+ description: 'Optional label text displayed above the select field'
+ placeholder:
+ description: 'Placeholder text displayed when no option is selected'
+ disabled:
+ description: 'Boolean flag to disable the select input, preventing user interaction'
+ multiple:
+ description: 'Enables multi-select mode allowing selection of multiple options'
+ initiallyOpened:
+ description: 'Opens the dropdown automatically when the component is rendered'
+ mandatory:
+ description: 'If true, requires a value to be selected, affecting validation behavior'
+ allowClear:
+ description: 'Shows a clear button to remove the selected value when enabled'
+ onChange:
+ description: 'Callback function triggered when the selection changes, receives the new selected value(s)'
+ labelComponent:
+ description: 'Custom component to render the label, allowing full customization of label appearance'
+ selectedItemComponent:
+ description: 'Custom component to render the selected item in the trigger, providing control over how selections are displayed'
+ placeholderComponent:
+ description: 'Custom component to render when no selection is made, replacing default placeholder text'
+ searchPlaceholder:
+ description: 'Placeholder text displayed in the search input field'
+ searchMessage:
+ description: 'Message displayed while user is typing in the search field'
+ loadingMessage:
+ description: 'Message displayed while search results are being loaded (useful for async searches)'
+ noMatchesMessage:
+ description: 'Message displayed when the search returns no matching results'
diff --git a/doc-app/translations/ember-input-validation/prefabs/select-search/fr-fr.yaml b/doc-app/translations/ember-input-validation/prefabs/select-search/fr-fr.yaml
new file mode 100644
index 00000000..2b6bf466
--- /dev/null
+++ b/doc-app/translations/ember-input-validation/prefabs/select-search/fr-fr.yaml
@@ -0,0 +1,35 @@
+properties:
+ validationField:
+ description: 'Le nom du champ dans le changeset pour la validation.'
+ changeset:
+ description: L'objet changeset pour la validation du formulaire.
+ label:
+ description: 'Le label du champ de sélection.'
+ placeholder:
+ description: 'Le texte de placeholder du champ de sélection.'
+ mandatory:
+ description: 'Indique si le champ de sélection est obligatoire.'
+ disabled:
+ description: 'Indique si le champ de sélection est désactivé.'
+ onChange:
+ description: L'action à appeler lors du changement de valeur.
+ options:
+ description: 'Les options disponibles pour la sélection.'
+ renderInPlace:
+ description: Afficher le dropdown à la place au lieu d'utiliser ember-wormhole.
+ allowClear:
+ description: 'Afficher un bouton pour effacer la sélection.'
+ searchEnabled:
+ description: 'Activer la recherche dans les options.'
+ searchField:
+ description: 'Le champ à utiliser pour la recherche.'
+ selected:
+ description: 'La valeur sélectionnée.'
+ loadingMessage:
+ description: 'Le message à afficher lors du chargement.'
+ noMatchesMessage:
+ description: Le message à afficher lorsqu'aucune option ne correspond.
+ onSearch:
+ description: 'La tâche ember-concurrency pour la recherche asynchrone.'
+ minSearchLength:
+ description: 'La longueur minimale de recherche pour déclencher onSearch.'
diff --git a/doc-app/translations/ember-input-validation/prefabs/select/en-us.yaml b/doc-app/translations/ember-input-validation/prefabs/select/en-us.yaml
new file mode 100644
index 00000000..f1b91884
--- /dev/null
+++ b/doc-app/translations/ember-input-validation/prefabs/select/en-us.yaml
@@ -0,0 +1,32 @@
+ember-input-validation:
+ prefabs:
+ select:
+ properties:
+ validationField:
+ description: 'The field name in the changeset for validation.'
+ changeset:
+ description: 'The changeset object for form validation.'
+ options:
+ description: 'The options to display in the select dropdown. Each option should have a toString() method for display.'
+ label:
+ description: 'The label for the input field.'
+ placeholder:
+ description: 'The placeholder text for the input field.'
+ disabled:
+ description: 'Whether the input field is disabled.'
+ multiple:
+ description: 'Whether multiple selections are allowed.'
+ mandatory:
+ description: 'Whether the select field is mandatory.'
+ initiallyOpened:
+ description: 'Whether the select dropdown is initially opened.'
+ allowClear:
+ description: 'Whether to show a button to clear the selection.'
+ onChange:
+ description: 'The action to be called when the selection changes.'
+ labelComponent:
+ description: 'The custom component to use for the label.'
+ selectedItemComponent:
+ description: 'The custom component to use for the selected item.'
+ placeholderComponent:
+ description: 'The custom component to use for the placeholder.'
diff --git a/doc-app/translations/ember-input-validation/prefabs/select/fr-fr.yaml b/doc-app/translations/ember-input-validation/prefabs/select/fr-fr.yaml
new file mode 100644
index 00000000..4bb540b5
--- /dev/null
+++ b/doc-app/translations/ember-input-validation/prefabs/select/fr-fr.yaml
@@ -0,0 +1,31 @@
+properties:
+ validationField:
+ description: 'Le nom du champ dans le changeset pour la validation.'
+ changeset:
+ description: L'objet changeset pour la validation du formulaire.
+ label:
+ description: 'Le label du champ de sélection.'
+ placeholder:
+ description: 'Le texte de placeholder du champ de sélection.'
+ mandatory:
+ description: 'Indique si le champ de sélection est obligatoire.'
+ disabled:
+ description: 'Indique si le champ de sélection est désactivé.'
+ onChange:
+ description: L'action à appeler lors du changement de valeur.
+ options:
+ description: 'Les options disponibles pour la sélection.'
+ renderInPlace:
+ description: Afficher le dropdown à la place au lieu d'utiliser ember-wormhole.
+ allowClear:
+ description: 'Afficher un bouton pour effacer la sélection.'
+ searchEnabled:
+ description: 'Activer la recherche dans les options.'
+ searchField:
+ description: 'Le champ à utiliser pour la recherche.'
+ selected:
+ description: 'La valeur sélectionnée.'
+ loadingMessage:
+ description: 'Le message à afficher lors du chargement.'
+ noMatchesMessage:
+ description: Le message à afficher lorsqu'aucune option ne correspond.
diff --git a/doc-app/translations/ember-input-validation/prefabs/textarea/en-us.yaml b/doc-app/translations/ember-input-validation/prefabs/textarea/en-us.yaml
new file mode 100644
index 00000000..ccd7be84
--- /dev/null
+++ b/doc-app/translations/ember-input-validation/prefabs/textarea/en-us.yaml
@@ -0,0 +1,19 @@
+properties:
+ validationField:
+ description: 'The field name in the changeset for validation.'
+ changeset:
+ description: 'The changeset object for form validation.'
+ label:
+ description: 'The label for the textarea field.'
+ placeholder:
+ description: 'The placeholder text for the textarea field.'
+ mandatory:
+ description: 'Whether the textarea field is mandatory.'
+ disabled:
+ description: 'Whether the input field is disabled.'
+ onChange:
+ description: 'The action to be called when the value changes.'
+ changeEvent:
+ description: 'The event to trigger the onChange action.'
+ maxLength:
+ description: 'The maximum length of the textarea field.'
diff --git a/doc-app/translations/ember-input-validation/prefabs/textarea/fr-fr.yaml b/doc-app/translations/ember-input-validation/prefabs/textarea/fr-fr.yaml
new file mode 100644
index 00000000..9eca6190
--- /dev/null
+++ b/doc-app/translations/ember-input-validation/prefabs/textarea/fr-fr.yaml
@@ -0,0 +1,21 @@
+properties:
+ validationField:
+ description: 'Le nom du champ dans le changeset pour la validation.'
+ changeset:
+ description: L'objet changeset pour la validation du formulaire.
+ label:
+ description: 'Le label du champ de texte.'
+ placeholder:
+ description: 'Le texte de placeholder du champ de texte.'
+ mandatory:
+ description: 'Indique si le champ de texte est obligatoire.'
+ disabled:
+ description: 'Indique si le champ de texte est désactivé.'
+ onChange:
+ description: L'action à appeler lors du changement de valeur.
+ changeEvent:
+ description: L'événement qui déclenche l'action onChange.
+ rows:
+ description: 'Le nombre de lignes visibles du textarea.'
+ maxLength:
+ description: 'La longueur maximale du texte.'
diff --git a/doc-app/translations/ember-input-validation/prefabs/timepicker/en-us.yaml b/doc-app/translations/ember-input-validation/prefabs/timepicker/en-us.yaml
new file mode 100644
index 00000000..a5eedf7a
--- /dev/null
+++ b/doc-app/translations/ember-input-validation/prefabs/timepicker/en-us.yaml
@@ -0,0 +1,25 @@
+properties:
+ validationField:
+ description: 'The field name in the changeset for validation.'
+ changeset:
+ description: 'The changeset object for form validation.'
+ label:
+ description: 'The label for the input field.'
+ onChange:
+ description: 'The action to be called when the time changes.'
+ onClose:
+ description: 'The action to be called when the timepicker closes.'
+ disabled:
+ description: 'Whether the input field is disabled.'
+ mandatory:
+ description: 'To indicate if input is mandatory.'
+ enableSecond:
+ description: 'Whether to enable seconds in the timepicker.'
+ stepping:
+ description: 'The step interval for minutes and seconds.'
+ placeholder:
+ description: 'The placeholder text for the input field.'
+ clearButton:
+ description: 'Whether to show a button to clear the input field.'
+ locale:
+ description: 'The locale to be used for time formatting.'
diff --git a/doc-app/translations/ember-input-validation/prefabs/timepicker/fr-fr.yaml b/doc-app/translations/ember-input-validation/prefabs/timepicker/fr-fr.yaml
new file mode 100644
index 00000000..78df6db4
--- /dev/null
+++ b/doc-app/translations/ember-input-validation/prefabs/timepicker/fr-fr.yaml
@@ -0,0 +1,27 @@
+properties:
+ validationField:
+ description: 'Le nom du champ dans le changeset pour la validation.'
+ changeset:
+ description: L'objet changeset pour la validation du formulaire.
+ label:
+ description: Le label du sélecteur d'heure.
+ placeholder:
+ description: Le texte de placeholder du sélecteur d'heure.
+ mandatory:
+ description: Indique si le sélecteur d'heure est obligatoire.
+ disabled:
+ description: Indique si le sélecteur d'heure est désactivé.
+ onChange:
+ description: L'action à appeler lors du changement d'heure.
+ locale:
+ description: La locale à utiliser pour le formatage de l'heure.
+ dateFormat:
+ description: Le format d'affichage de l'heure sélectionnée.
+ enableTime:
+ description: Activer le sélecteur d'heure (toujours true pour timepicker).
+ noCalendar:
+ description: 'Masquer le calendrier (toujours true pour timepicker).'
+ stepping:
+ description: L'incrément du sélecteur d'heure en minutes.
+ enableSecond:
+ description: 'Afficher le sélecteur de secondes.'
diff --git a/doc-app/translations/ember-input-validation/prefabs/vat/en-us.yaml b/doc-app/translations/ember-input-validation/prefabs/vat/en-us.yaml
new file mode 100644
index 00000000..7ffdcb67
--- /dev/null
+++ b/doc-app/translations/ember-input-validation/prefabs/vat/en-us.yaml
@@ -0,0 +1,17 @@
+properties:
+ validationField:
+ description: 'The field name in the changeset for validation.'
+ changeset:
+ description: 'The changeset object for form validation.'
+ label:
+ description: 'The label for the input field.'
+ placeholder:
+ description: 'The placeholder text for the input field.'
+ mandatory:
+ description: 'Whether the input field is mandatory.'
+ disabled:
+ description: 'Whether the input field is disabled.'
+ onChange:
+ description: 'The action to be called when the value changes.'
+ changeEvent:
+ description: 'The event to trigger the onChange action.'
diff --git a/doc-app/translations/ember-input-validation/prefabs/vat/fr-fr.yaml b/doc-app/translations/ember-input-validation/prefabs/vat/fr-fr.yaml
new file mode 100644
index 00000000..093abcf4
--- /dev/null
+++ b/doc-app/translations/ember-input-validation/prefabs/vat/fr-fr.yaml
@@ -0,0 +1,17 @@
+properties:
+ validationField:
+ description: 'Le nom du champ dans le changeset pour la validation.'
+ changeset:
+ description: L'objet changeset pour la validation du formulaire.
+ label:
+ description: 'Le label du champ de saisie.'
+ placeholder:
+ description: 'Le texte de placeholder du champ de saisie.'
+ mandatory:
+ description: 'Indique si le champ de saisie est obligatoire.'
+ disabled:
+ description: 'Indique si le champ de saisie est désactivé.'
+ onChange:
+ description: L'action à appeler lors du changement de valeur.
+ mask:
+ description: 'Le masque de saisie pour le numéro de TVA.'
diff --git a/doc-app/translations/ember-input/prefabs/button/en-us.yaml b/doc-app/translations/ember-input/prefabs/button/en-us.yaml
new file mode 100644
index 00000000..93afc5c9
--- /dev/null
+++ b/doc-app/translations/ember-input/prefabs/button/en-us.yaml
@@ -0,0 +1,8 @@
+properties:
+ field:
+ label:
+ description: 'The label for the button field'
+ on-click:
+ description: 'The action to be called when the button is clicked'
+ disabled:
+ description: 'Whether the button field is disabled'
diff --git a/doc-app/translations/ember-input/prefabs/button/fr-fr.yaml b/doc-app/translations/ember-input/prefabs/button/fr-fr.yaml
new file mode 100644
index 00000000..8eacd4ad
--- /dev/null
+++ b/doc-app/translations/ember-input/prefabs/button/fr-fr.yaml
@@ -0,0 +1,8 @@
+properties:
+ field:
+ label:
+ description: 'Le label du bouton'
+ on-click:
+ description: L'action à appeler lors du clic sur le bouton
+ disabled:
+ description: 'Indique si le bouton est désactivé'
diff --git a/doc-app/translations/ember-input/prefabs/toggle/en-us.yaml b/doc-app/translations/ember-input/prefabs/toggle/en-us.yaml
new file mode 100644
index 00000000..1413e07e
--- /dev/null
+++ b/doc-app/translations/ember-input/prefabs/toggle/en-us.yaml
@@ -0,0 +1,8 @@
+properties:
+ field:
+ label:
+ description: 'The label for the toggle field'
+ checked:
+ description: 'Whether the toggle is checked'
+ disabled:
+ description: 'Whether the toggle field is disabled'
diff --git a/doc-app/translations/ember-input/prefabs/toggle/fr-fr.yaml b/doc-app/translations/ember-input/prefabs/toggle/fr-fr.yaml
new file mode 100644
index 00000000..548c9a7e
--- /dev/null
+++ b/doc-app/translations/ember-input/prefabs/toggle/fr-fr.yaml
@@ -0,0 +1,8 @@
+properties:
+ field:
+ label:
+ description: 'Le label du bouton'
+ checked:
+ description: 'Indique si le bouton est coché'
+ disabled:
+ description: 'Indique si le bouton est désactivé'
diff --git a/doc-app/translations/ember-ui/prefabs/confirm-modal/en-us.yaml b/doc-app/translations/ember-ui/prefabs/confirm-modal/en-us.yaml
new file mode 100644
index 00000000..0805d302
--- /dev/null
+++ b/doc-app/translations/ember-ui/prefabs/confirm-modal/en-us.yaml
@@ -0,0 +1,13 @@
+properties:
+ onClose:
+ description: 'Function to close the modal.'
+ onConfirm:
+ description: 'Function called when the user confirms the action.'
+ cancelText:
+ description: 'Text to display on the cancel button.'
+ confirmText:
+ description: 'Text to display on the confirm button.'
+ confirmQuestion:
+ description: 'The confirmation question to display to the user.'
+ isOpen:
+ description: 'Boolean to control the modal visibility.'
diff --git a/doc-app/translations/ember-ui/prefabs/confirm-modal/fr-fr.yaml b/doc-app/translations/ember-ui/prefabs/confirm-modal/fr-fr.yaml
new file mode 100644
index 00000000..83c940f5
--- /dev/null
+++ b/doc-app/translations/ember-ui/prefabs/confirm-modal/fr-fr.yaml
@@ -0,0 +1,13 @@
+properties:
+ onClose:
+ description: 'Fonction pour fermer la modale.'
+ onConfirm:
+ description: Fonction appelée lorsque l'utilisateur confirme l'action.
+ cancelText:
+ description: 'Texte à afficher sur le bouton annuler.'
+ confirmText:
+ description: 'Texte à afficher sur le bouton confirmer.'
+ confirmQuestion:
+ description: La question de confirmation à afficher à l'utilisateur.
+ isOpen:
+ description: 'Booléen pour contrôler la visibilité de la modale.'
diff --git a/doc-app/translations/ember-ui/prefabs/tpk-form/en-us.yaml b/doc-app/translations/ember-ui/prefabs/tpk-form/en-us.yaml
new file mode 100644
index 00000000..66ac9c88
--- /dev/null
+++ b/doc-app/translations/ember-ui/prefabs/tpk-form/en-us.yaml
@@ -0,0 +1,99 @@
+properties:
+ changeset:
+ description: 'An instance of ImmerChangeset containing the form data.'
+ onSubmit:
+ description: 'A callback function executed when the form is submitted with valid data.'
+ validationSchema:
+ description: 'A Zod schema that defines the validation rules for the form fields.'
+ reactive:
+ description: 'When enabled, validates individual fields immediately when their values change. Default: true.'
+ removeErrorsOnSubmit:
+ description: 'Clears all existing validation errors before performing validation on submit. Default: true.'
+ autoScrollOnError:
+ description: 'Automatically scrolls to the first validation error when submission fails. Default: true.'
+ disabled:
+ description: 'Disables all form inputs when set to true. Default: false.'
+ executeOnValid:
+ description: 'Automatically executes the changeset (applies draft changes to data) when validation passes. Default: true.'
+sections:
+ yieldedComponents:
+ title: 'Available Yielded Components'
+ description: 'The TpkForm component yields numerous pre-configured components, all automatically bound with the changeset, disabled state, and required fields.'
+ baseComponents:
+ title: 'Base Components (for custom layouts)'
+ note: 'Base components give you full control over the markup:'
+ items:
+ input: 'Base input component'
+ textarea: 'Base textarea component'
+ select: 'Base select component'
+ checkbox: 'Base checkbox component'
+ radio: 'Base radio component'
+ radioGroup: 'Radio group component'
+ file: 'Base file input component'
+ datepicker: 'Base datepicker component'
+ prefabComponents:
+ title: 'Prefab Components (ready-to-use)'
+ items:
+ input: 'Standard text input'
+ textarea: 'Textarea with validation'
+ select: 'Select dropdown'
+ selectCreate: 'Select with create option'
+ selectSearch: 'Searchable select'
+ checkbox: 'Checkbox with label'
+ radio: 'Single radio button'
+ radioGroup: 'Radio button group'
+ file: 'File upload input'
+ specializedInputs:
+ title: 'Specialized Input Prefabs'
+ items:
+ password: 'Password input with visibility toggle'
+ email: 'Email input with validation'
+ mobile: 'Mobile phone number input'
+ iban: 'IBAN (bank account) input'
+ bic: 'BIC/SWIFT code input'
+ vat: 'VAT number input'
+ nationalNumber: 'National identification number'
+ currency: 'Currency/money input'
+ integer: 'Integer number input'
+ number: 'Decimal number input'
+ dateTime:
+ title: 'Date/Time Prefabs'
+ items:
+ datepicker: 'Single date picker'
+ datepickerRange: 'Date range picker'
+ timepicker: 'Time picker'
+ helpers:
+ title: 'Yielded Helper Values'
+ items:
+ changesetGet: 'Function to retrieve values from the changeset (shortcut for changeset.get())'
+ requiredFields: 'Array of field names that are required according to the validation schema'
+ usingBaseComponents:
+ title: 'Using Base Components for Custom Layouts'
+ description: 'Base components give you full control over the markup.'
+ basic: 'Basic usage'
+ validationBehavior:
+ title: 'Validation Behavior'
+ reactive:
+ title: 'Reactive Validation (Default)'
+ description: 'When reactive is true by default, fields are validated as soon as their values change.'
+ basic: 'Basic usage'
+ submitOnly:
+ title: 'Submit-Only Validation'
+ description: 'Set reactive at false to validate only when the form is submitted.'
+ basic: 'Basic usage'
+ errorHandling:
+ title: 'Error Handling and Auto-Scrolling'
+ description: 'Control error clearing and auto-scroll behavior with @removeErrorsOnSubmit and @autoScrollOnError properties.'
+ basic: 'Basic usage'
+ disabledState:
+ title: 'Disabled State'
+ description: "Disable the entire form and all its inputs by setting @disabled='{true}'."
+ basic: 'Basic usage'
+ requiredFields:
+ title: 'Working with Required Fields'
+ description: 'Access the list of required fields from the validation schema using the yielded F.requiredFields array.'
+ basic: 'Basic usage'
+ changesetGetHelper:
+ title: 'changesetGet Helper'
+ description: 'Use the changesetGet helper to retrieve values without repeating the @changeset argument.'
+ basic: 'Basic usage'
diff --git a/doc-app/translations/ember-ui/prefabs/tpk-form/fr-fr.yaml b/doc-app/translations/ember-ui/prefabs/tpk-form/fr-fr.yaml
new file mode 100644
index 00000000..423e0381
--- /dev/null
+++ b/doc-app/translations/ember-ui/prefabs/tpk-form/fr-fr.yaml
@@ -0,0 +1,99 @@
+properties:
+ changeset:
+ description: 'Une instance de ImmerChangeset contenant les données du formulaire.'
+ onSubmit:
+ description: 'Une fonction de rappel exécutée lorsque le formulaire est soumis avec des données valides.'
+ validationSchema:
+ description: 'Un schéma Zod qui définit les règles de validation pour les champs du formulaire.'
+ reactive:
+ description: "Lorsqu'activé, valide les champs individuels immédiatement lorsque leurs valeurs changent. Par défaut: true."
+ removeErrorsOnSubmit:
+ description: "Efface toutes les erreurs de validation existantes avant d'effectuer la validation lors de la soumission. Par défaut: true."
+ autoScrollOnError:
+ description: "Fait défiler automatiquement jusqu'à la première erreur de validation lorsque la soumission échoue. Par défaut: true."
+ disabled:
+ description: 'Désactive toutes les entrées du formulaire lorsque défini sur true. Par défaut: false.'
+ executeOnValid:
+ description: 'Exécute automatiquement le changeset (applique les modifications du brouillon aux données) lorsque la validation réussit. Par défaut: true.'
+ sections:
+ yieldedComponents:
+ title: 'Composants Yielded Disponibles'
+ description: "Le composant TpkForm yield de nombreux composants préconfigurés, tous automatiquement liés avec le changeset, l'état désactivé et les champs requis."
+ baseComponents:
+ title: 'Composants de Base (pour layouts personnalisés)'
+ note: 'Les composants de base vous donnent un contrôle total sur le markup :'
+ items:
+ input: 'Composant input de base'
+ textarea: 'Composant textarea de base'
+ select: 'Composant select de base'
+ checkbox: 'Composant checkbox de base'
+ radio: 'Composant radio de base'
+ radioGroup: 'Composant groupe de radios'
+ file: 'Composant fichier de base'
+ datepicker: 'Composant datepicker de base'
+ prefabComponents:
+ title: Composants Prefab (prêts à l'emploi)
+ items:
+ input: 'Input texte standard'
+ textarea: 'Textarea avec validation'
+ select: 'Menu déroulant select'
+ selectCreate: 'Select avec option de création'
+ selectSearch: 'Select avec recherche'
+ checkbox: 'Checkbox avec label'
+ radio: 'Bouton radio unique'
+ radioGroup: 'Groupe de boutons radio'
+ file: 'Input de téléchargement de fichier'
+ specializedInputs:
+ title: "Prefabs d'Input Spécialisés"
+ items:
+ password: 'Input mot de passe avec toggle de visibilité'
+ email: 'Input email avec validation'
+ mobile: 'Input numéro de téléphone mobile'
+ iban: 'Input IBAN (compte bancaire)'
+ bic: 'Input code BIC/SWIFT'
+ vat: 'Input numéro de TVA'
+ nationalNumber: "Input numéro d'identification national"
+ currency: 'Input devise/argent'
+ integer: 'Input nombre entier'
+ number: 'Input nombre décimal'
+ dateTime:
+ title: 'Prefabs Date/Heure'
+ items:
+ datepicker: 'Sélecteur de date unique'
+ datepickerRange: 'Sélecteur de plage de dates'
+ timepicker: "Sélecteur d'heure"
+ helpers:
+ title: 'Valeurs Helper Yielded'
+ items:
+ changesetGet: 'Fonction pour récupérer des valeurs du changeset (raccourci pour changeset.get())'
+ requiredFields: 'Tableau des noms de champs requis selon le schéma de validation'
+ usingBaseComponents:
+ title: 'Utilisation des Composants de Base pour Layouts Personnalisés'
+ description: 'Les composants de base vous donnent un contrôle total sur le markup.'
+ basic: 'Utilisation basique'
+ validationBehavior:
+ title: 'Comportement de Validation'
+ reactive:
+ title: 'Validation Réactive (Par défaut)'
+ description: 'Lorsque reactive est true par défaut, les champs sont validés dès que leurs valeurs changent.'
+ basic: 'Utilisation basique'
+ submitOnly:
+ title: 'Validation Uniquement à la Soumission'
+ description: 'Définissez reactive à false pour valider uniquement lors de la soumission du formulaire.'
+ basic: 'Utilisation basique'
+ errorHandling:
+ title: 'Gestion des Erreurs et Défilement Automatique'
+ description: Contrôlez l'effacement des erreurs et le comportement de défilement automatique avec les propriétés @removeErrorsOnSubmit et @autoScrollOnError.
+ basic: 'Utilisation basique'
+ disabledState:
+ title: 'État Désactivé'
+ description: "Désactivez l'ensemble du formulaire et toutes ses entrées en définissant @disabled='{true}'."
+ basic: 'Utilisation basique'
+ requiredFields:
+ title: 'Travailler avec les Champs Requis'
+ description: 'Accédez à la liste des champs requis depuis le schéma de validation en utilisant le tableau yielded F.requiredFields.'
+ basic: 'Utilisation basique'
+ changesetGetHelper:
+ title: 'Helper changesetGet'
+ description: "Utilisez le helper changesetGet pour récupérer des valeurs sans répéter l'argument @changeset."
+ basic: 'Utilisation basique'
diff --git a/doc-app/translations/ember-ui/prefabs/tpk-table-generic-prefab/en-us.yaml b/doc-app/translations/ember-ui/prefabs/tpk-table-generic-prefab/en-us.yaml
new file mode 100644
index 00000000..7167258e
--- /dev/null
+++ b/doc-app/translations/ember-ui/prefabs/tpk-table-generic-prefab/en-us.yaml
@@ -0,0 +1,21 @@
+properties:
+ tableParams:
+ description: 'Main configuration object containing all table settings and data'
+ columnsComponent:
+ description: 'Object mapping component names to their implementations for custom column rendering'
+ entity:
+ description: 'The name of the entity type to fetch and display in the table'
+ pageSizes:
+ description: 'Array of available page size options for pagination (default: [5, 10, 25])'
+ defaultSortColumn:
+ description: 'The field name to sort by initially when the table loads'
+ additionalFilters:
+ description: 'Additional query parameters to filter the table data'
+ relationships:
+ description: 'Comma-separated list of relationships to include in the data fetch'
+ rowClick:
+ description: 'Callback function triggered when a table row is clicked'
+ columns:
+ description: 'Array of column definitions specifying field mappings, headers, and rendering options'
+ actionMenu:
+ description: 'Array of action items to display in the row action menu'
diff --git a/doc-app/translations/ember-ui/prefabs/tpk-table-generic-prefab/fr-fr.yaml b/doc-app/translations/ember-ui/prefabs/tpk-table-generic-prefab/fr-fr.yaml
new file mode 100644
index 00000000..ff06a758
--- /dev/null
+++ b/doc-app/translations/ember-ui/prefabs/tpk-table-generic-prefab/fr-fr.yaml
@@ -0,0 +1,21 @@
+properties:
+ tableParams:
+ description: 'Objet de configuration principal contenant tous les paramètres et données du tableau'
+ columnsComponent:
+ description: 'Objet mappant les noms de composants à leurs implémentations pour le rendu personnalisé des colonnes'
+ entity:
+ description: "Le nom du type d'entité à récupérer et afficher dans le tableau"
+ pageSizes:
+ description: 'Tableau des options de taille de page disponibles pour la pagination (par défaut: [5, 10, 25])'
+ defaultSortColumn:
+ description: 'Le nom du champ à trier initialement lors du chargement du tableau'
+ additionalFilters:
+ description: 'Paramètres de requête supplémentaires pour filtrer les données du tableau'
+ relationships:
+ description: 'Liste séparée par des virgules des relations à inclure dans la récupération des données'
+ rowClick:
+ description: 'Fonction de rappel déclenchée lors du clic sur une ligne du tableau'
+ columns:
+ description: 'Tableau de définitions de colonnes spécifiant les mappages de champs, en-têtes et options de rendu'
+ actionMenu:
+ description: "Tableau d'éléments d'action à afficher dans le menu d'action de ligne"
diff --git a/doc-app/translations/en-us.yaml b/doc-app/translations/en-us.yaml
index 594373e0..80e03e44 100644
--- a/doc-app/translations/en-us.yaml
+++ b/doc-app/translations/en-us.yaml
@@ -1,8 +1,192 @@
global:
- search: "Search"
- previous: "Previous"
- next: "Next"
- results: "Results"
- results_by_page: "Results by page"
- on: "on"
- error: "Error"
+ on: 'on'
+ results: 'results'
+ results_by_page: 'results by page'
+
+docs:
+ sections:
+ properties: 'Properties'
+ usage: 'Usage'
+ examples: 'Examples'
+
+ propertyTable:
+ name: 'Name'
+ type: 'Type'
+ required: 'Required'
+ description: 'Description'
+ yes: 'Yes'
+ no: 'No'
+
+emberInputValidation:
+ prefabs:
+ input:
+ title: 'Input'
+ description: 'This component provides a validated input field with label and error handling.'
+ examples:
+ title: 'Examples'
+ basic: 'Basic usage'
+ number:
+ title: 'Number'
+ description: 'The number validation input can be blocked at a minimum of 0 or be a negative number.'
+ examples:
+ title: 'Examples'
+ unsigned: 'Unsigned Number'
+ basic: 'Basic usage'
+ bic:
+ title: 'BIC'
+ description: 'This is an input with a built-in mask for BIC. The mask should be compatible for any BIC and text can only be in capital letters.'
+ examples:
+ title: 'Examples'
+ basic: 'Basic usage'
+ currency:
+ title: 'Currency'
+ description: 'A reusable validation component for currency input with integrated error handling and euro formatting mask.'
+ examples:
+ title: 'Examples'
+ basic: 'Basic Currency'
+ datepicker:
+ title: 'Datepicker'
+ description: 'A reusable validation component for date selection with integrated error handling and extensive customization options.'
+ examples:
+ title: 'Examples'
+ basic: 'Basic usage'
+ datepickerRange:
+ title: 'Datepicker Range validation prefab'
+ description: 'A reusable validation component for date range selection with integrated error handling'
+ examples:
+ title: 'Examples'
+ basic: 'Basic Datepicker Range'
+ email:
+ title: 'Email'
+ description: 'A reusable validation component for email input with integrated error handling'
+ examples:
+ title: 'Examples'
+ basic: 'Basic usage'
+ file:
+ title: 'File'
+ description: 'A reusable validation component for single file upload with integrated error handling'
+ examples:
+ title: 'Examples'
+ basic: 'Basic usage'
+ fileList:
+ title: 'File List'
+ description: 'A reusable validation component for multiple file upload with drag and drop support, integrated error handling, and file management features'
+ examples:
+ title: 'Examples'
+ basic: 'Basic usage'
+ iban:
+ title: 'IBAN'
+ description: 'A reusable validation component for IBAN input with built-in mask supporting Belgian, French, Luxembourgish, Dutch and German IBANs with automatic formatting'
+ examples:
+ title: 'Examples'
+ basic: 'Basic usage'
+ integer:
+ title: 'Integer'
+ description: 'A reusable validation component for integer input that prevents decimal numbers and can be restricted to unsigned values (minimum 0) or allow negative numbers'
+ examples:
+ title: 'Examples'
+ basic: 'Basic usage'
+ mobile:
+ title: 'Mobile'
+ description: 'A reusable validation component for mobile phone numbers with country prefix support (Luxembourg, Germany, Netherlands, Belgium, France) and integrated error handling'
+ examples:
+ title: 'Examples'
+ basic: 'Basic usage'
+ nationalNumber:
+ title: 'National Number'
+ description: 'A reusable validation component for Belgian national number input with built-in mask that formats the number in the pretty format similar to the one on Belgian ID cards'
+ examples:
+ title: 'Examples'
+ basic: 'Basic usage'
+ password:
+ title: 'Password'
+ description: 'A reusable validation component for password input fields with secure masking and integrated error handling'
+ examples:
+ title: 'Examples'
+ basic: 'Basic usage'
+ radio:
+ title: 'Radio'
+ description: 'A reusable validation component for single radio button with integrated error handling'
+ examples:
+ title: 'Examples'
+ basic: 'Basic usage'
+ radioGroup:
+ title: 'Radio Group'
+ description: 'A reusable validation component for radio button groups with integrated error handling and customizable options'
+ examples:
+ title: 'Examples'
+ basic: 'Basic usage'
+ select:
+ title: 'Select'
+ description: 'A powerful select component with built-in validation using ember-power-select'
+ examples:
+ title: 'Examples'
+ basic: 'Basic usage'
+ selectCreate:
+ title: 'Select Create'
+ description: 'A powerful select component with ability to create new values and built-in validation using ember-power-select and ember-power-select-with-create'
+ examples:
+ title: 'Examples'
+ basic: 'Basic usage'
+ selectSearch:
+ title: 'Select Search'
+ description: 'A powerful select component with search and built-in validation using ember-power-select'
+ examples:
+ title: 'Examples'
+ basic: 'Basic usage'
+ textarea:
+ title: 'Textarea'
+ description: 'A reusable validation component for textarea fields with integrated error handling and optional character limit'
+ examples:
+ title: 'Examples'
+ basic: 'Basic usage'
+ timepicker:
+ title: 'Timepicker'
+ description: 'A reusable validation component for time selection with integrated error handling and customizable options'
+ examples:
+ title: 'Examples'
+ basic: 'Basic usage'
+ vat:
+ title: 'VAT'
+ description: 'An input component with built-in mask for VAT numbers supporting Belgian, French, Luxembourgish, Dutch and German VAT formats'
+ examples:
+ title: 'Examples'
+ basic: 'Basic usage'
+
+ember-ui:
+ prefabs:
+ confirm-modal:
+ title: 'Confirm Modal'
+ description: 'A modal component for confirmation dialogs.'
+ examples:
+ title: 'Examples'
+ basic: 'Basic usage'
+ tpk-table-generic-prefab:
+ title: 'Tpk Table Generic Prefab'
+ description: 'A generic table component with sorting, pagination, filtering, and customizable columns.'
+ examples:
+ title: 'Examples'
+ basic: 'Basic usage'
+ tpk-form:
+ title: 'Tpk Form'
+ description: 'A comprehensive form component that integrates validation using ember-immer-changeset and zod.'
+ examples:
+ title: 'Examples'
+ basic: 'Basic usage'
+
+emberInput:
+ prefabs:
+ button:
+ title: 'Button'
+ description: 'A simple button wrapper component with customizable label and click handler.'
+ examples:
+ title: 'Examples'
+ basic: 'Basic usage'
+ disabled: 'Disabled button'
+ toggle:
+ title: 'Toggle'
+ description: 'A simple toggle wrapper component with customizable label and checked state.'
+ examples:
+ title: 'Examples'
+ basic: 'Basic usage'
+ disabled: 'Disabled button'
diff --git a/doc-app/translations/fr-fr.yaml b/doc-app/translations/fr-fr.yaml
new file mode 100644
index 00000000..9a2f4525
--- /dev/null
+++ b/doc-app/translations/fr-fr.yaml
@@ -0,0 +1,185 @@
+global:
+ on: 'sur'
+ results: 'résultats'
+ results_by_page: 'résultats par page'
+
+docs:
+ sections:
+ properties: 'Propriétés'
+ usage: 'Utilisation'
+ examples: 'Exemples'
+
+ propertyTable:
+ name: 'Nom'
+ type: 'Type'
+ required: 'Requis'
+ description: 'Description'
+ yes: 'Oui'
+ no: 'Non'
+
+emberInputValidation:
+ prefabs:
+ input:
+ title: 'Input'
+ description: 'Ce composant fournit un champ de saisie validé avec label et gestion des erreurs.'
+ examples:
+ title: 'Exemples'
+ basic: 'Utilisation basique'
+ number:
+ title: 'Number'
+ description: "L'input de validation numérique peut être bloqué à un minimum de 0 ou accepter des nombres négatifs."
+ examples:
+ title: 'Exemples'
+ unsigned: 'Nombre non signé'
+ basic: 'Utilisation basique'
+ bic:
+ title: 'BIC'
+ description: "Ceci est un input avec un masque intégré pour le BIC. Le masque est compatible avec tout BIC et le texte ne peut être qu'en lettres majuscules."
+ examples:
+ title: 'Exemples'
+ basic: 'Utilisation basique'
+ currency:
+ title: 'Devise'
+ description: 'Un composant de validation réutilisable pour la saisie de montants avec gestion des erreurs intégrée et masque de formatage euro.'
+ examples:
+ title: 'Exemples'
+ basic: 'Devise basique'
+ datepicker:
+ title: 'Sélecteur de date'
+ description: 'Un composant de validation réutilisable pour la sélection de dates avec gestion des erreurs intégrée et options de personnalisation étendues.'
+ examples:
+ title: 'Exemples'
+ basic: 'Utilisation basique'
+ datepickerRange:
+ title: 'Préfabriqué de validation plage de dates'
+ description: 'Un composant de validation réutilisable pour la sélection de plages de dates avec gestion des erreurs intégrée'
+ examples:
+ title: 'Exemples'
+ basic: 'Plage de dates basique'
+ email:
+ title: 'Email'
+ description: Un composant de validation réutilisable pour la saisie d'email avec gestion des erreurs intégrée
+ examples:
+ title: 'Exemples'
+ basic: 'Utilisation basique'
+ file:
+ title: 'Fichier'
+ description: 'Un composant de validation réutilisable pour le téléchargement de fichier unique avec gestion des erreurs intégrée'
+ examples:
+ title: 'Exemples'
+ basic: 'Utilisation basique'
+ fileList:
+ title: 'Liste de fichiers'
+ description: 'Un composant de validation réutilisable pour le téléchargement de fichiers multiples avec support du glisser-déposer, gestion des erreurs intégrée et fonctionnalités de gestion des fichiers'
+ examples:
+ title: 'Exemples'
+ basic: 'Utilisation basique'
+ iban:
+ title: 'IBAN'
+ description: Un composant de validation réutilisable pour la saisie d'IBAN avec masque intégré supportant les IBAN belges, français, luxembourgeois, néerlandais et allemands avec formatage automatique
+ examples:
+ title: 'Exemples'
+ basic: 'Utilisation basique'
+ integer:
+ title: 'Entier'
+ description: Un composant de validation réutilisable pour la saisie d'entiers qui empêche les nombres décimaux et peut être restreint aux valeurs non signées (minimum 0) ou autoriser les nombres négatifs
+ examples:
+ title: 'Exemples'
+ basic: 'Utilisation basique'
+ mobile:
+ title: 'Mobile'
+ description: 'Un composant de validation réutilisable pour les numéros de téléphone mobile avec support des préfixes pays (Luxembourg, Allemagne, Pays-Bas, Belgique, France) et gestion des erreurs intégrée'
+ examples:
+ title: 'Exemples'
+ basic: 'Utilisation basique'
+ nationalNumber:
+ title: 'Numéro national'
+ description: Un composant de validation réutilisable pour la saisie de numéro national belge avec masque intégré qui formate le numéro dans le format lisible similaire à celui des cartes d'identité belges
+ examples:
+ title: 'Exemples'
+ basic: 'Utilisation basique'
+ password:
+ title: 'Mot de passe'
+ description: 'Un composant de validation réutilisable pour les champs de saisie de mot de passe avec masquage sécurisé et gestion des erreurs intégrée'
+ examples:
+ title: 'Exemples'
+ basic: 'Utilisation basique'
+ radio:
+ title: 'Radio'
+ description: 'Un composant de validation réutilisable pour un bouton radio unique avec gestion des erreurs intégrée'
+ examples:
+ title: 'Exemples'
+ basic: 'Utilisation basique'
+ radioGroup:
+ title: 'Groupe de radios'
+ description: 'Un composant de validation réutilisable pour les groupes de boutons radio avec gestion des erreurs intégrée et options personnalisables'
+ examples:
+ title: 'Exemples'
+ basic: 'Utilisation basique'
+ select:
+ title: 'Select'
+ description: 'Un composant select puissant avec validation intégrée utilisant ember-power-select'
+ examples:
+ title: 'Exemples'
+ basic: 'Utilisation basique'
+ selectCreate:
+ title: 'Select Create'
+ description: 'Un composant select puissant avec la possibilité de créer de nouvelles valeurs et validation intégrée utilisant ember-power-select et ember-power-select-with-create'
+ examples:
+ title: 'Exemples'
+ basic: 'Utilisation basique'
+ selectSearch:
+ title: 'Select Search'
+ description: 'Un composant select puissant avec recherche et validation intégrée utilisant ember-power-select'
+ examples:
+ title: 'Exemples'
+ basic: 'Utilisation basique'
+ textarea:
+ title: 'Textarea'
+ description: 'Un composant de validation réutilisable pour les champs textarea avec gestion des erreurs intégrée et limite de caractères optionnelle'
+ examples:
+ title: 'Exemples'
+ basic: 'Utilisation basique'
+ timepicker:
+ title: Sélecteur d'heure
+ description: Un composant de validation réutilisable pour la sélection d'heure avec gestion des erreurs intégrée et options personnalisables
+ examples:
+ title: 'Exemples'
+ basic: 'Utilisation basique'
+ vat:
+ title: 'TVA'
+ description: 'Un composant input avec masque intégré pour les numéros de TVA supportant les formats belge, français, luxembourgeois, néerlandais et allemand'
+ examples:
+ title: 'Exemples'
+ basic: 'Utilisation basique'
+
+ember-ui:
+ prefabs:
+ confirm-modal:
+ title: 'Modale de confirmation'
+ description: 'Un composant de modale pour les dialogues de confirmation.'
+ examples:
+ title: 'Exemples'
+ basic: 'Utilisation basique'
+ tpk-table-generic-prefab:
+ title: 'Tpk Table Generic Prefab'
+ description: 'Un composant de tableau générique avec tri, pagination, filtrage et colonnes personnalisables.'
+ examples:
+ title: 'Exemples'
+ basic: 'Utilisation basique'
+ tpk-form:
+ title: 'Tpk Form'
+ description: 'Un composant de formulaire complet qui intègre la validation en utilisant ember-immer-changeset et zod.'
+ examples:
+ title: 'Exemples'
+ basic: 'Utilisation basique'
+
+emberInput:
+ prefabs:
+ button:
+ title: 'Bouton'
+ description: 'Un composant bouton simple avec label et gestionnaire de clic personnalisables.'
+ examples:
+ title: 'Exemples'
+ basic: 'Utilisation basique'
+ disabled: 'Bouton désactivé'
diff --git a/doc-app/tsconfig.json b/doc-app/tsconfig.json
index 9ac5d3b1..cd1d8343 100644
--- a/doc-app/tsconfig.json
+++ b/doc-app/tsconfig.json
@@ -1,20 +1,18 @@
{
- "extends": "@tsconfig/ember/tsconfig.json",
+ "extends": "@ember/app-tsconfig",
+ "include": ["app", "tests", "types"],
"compilerOptions": {
- // The combination of `baseUrl` with `paths` allows Ember's classic package
- // layout, which is not resolvable with the Node resolution algorithm, to
- // work with TypeScript.
- "baseUrl": ".",
+ "allowJs": true,
"paths": {
- "doc-app/tests/*": ["tests/*"],
- "doc-app/*": ["app/*"],
- "*": ["types/*"]
- }
- },
- "glint": {
- "environment": [
- "ember-loose",
- "ember-template-imports"
+ "doc-app/tests/*": ["./tests/*"],
+ "doc-app/*": ["./app/*"],
+ "*": ["./types/*"]
+ },
+ "types": [
+ "ember-source/types",
+ "@embroider/core/virtual",
+ "vite/client",
+ "@ember-intl/vite/virtual"
]
}
}
diff --git a/doc-app/types/ember-data/types/registries/model.d.ts b/doc-app/types/ember-data/types/registries/model.d.ts
deleted file mode 100644
index bdd8c0f1..00000000
--- a/doc-app/types/ember-data/types/registries/model.d.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-/**
- * Catch-all for ember-data.
- */
-export default interface ModelRegistry {
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- [key: string]: any;
-}
diff --git a/doc-app/types/global.d.ts b/doc-app/types/global.d.ts
deleted file mode 100644
index ebc74946..00000000
--- a/doc-app/types/global.d.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-import '@glint/environment-ember-loose';
-import { Registry as InputR } from '@triptyk/ember-input/template-registry';
-import { Registry as InputVR } from '@triptyk/ember-input-validation/template-registry';
-import type EmberIntlRegistry from 'ember-intl/template-registry';
-
-declare module '@glint/environment-ember-loose/registry' {
- export default interface Registry extends EmberIntlRegistry, InputR, InputVR {
- // local entries
- }
-}
diff --git a/doc-app/vite.config.mjs b/doc-app/vite.config.mjs
new file mode 100644
index 00000000..86d36811
--- /dev/null
+++ b/doc-app/vite.config.mjs
@@ -0,0 +1,36 @@
+import { defineConfig } from 'vite';
+import { extensions, classicEmberSupport, ember } from '@embroider/vite';
+import { babel } from '@rollup/plugin-babel';
+import tailwindcss from '@tailwindcss/vite';
+import { webdriverio } from '@vitest/browser-webdriverio';
+import { loadTranslations } from '@ember-intl/vite';
+
+export default defineConfig({
+ plugins: [
+ tailwindcss(),
+ classicEmberSupport(),
+ ember(),
+ // extra plugins here
+ babel({
+ babelHelpers: 'runtime',
+ extensions,
+ }),
+ loadTranslations(),
+ ],
+ test: {
+ include: ['tests/**/*-vitest-test.{gjs,gts}'],
+ maxConcurrency: 1,
+ browser: {
+ provider: webdriverio(),
+ enabled: true,
+ headless: false,
+ // at least one instance is required
+ instances: [
+ { browser: 'chrome' },
+ // { browser: 'firefox' },
+ // { browser: 'edge' },
+ // { browser: 'safari' },
+ ],
+ },
+ },
+});
diff --git a/ember-common-ui.code-workspace b/ember-common-ui.code-workspace
index 7c05671e..57a730e3 100644
--- a/ember-common-ui.code-workspace
+++ b/ember-common-ui.code-workspace
@@ -26,5 +26,9 @@
"name": "ember-ui",
"path": "packages/ember-ui",
},
+ {
+ "name": "ember-utils",
+ "path": "packages/ember-utils",
+ },
],
}
diff --git a/lerna.json b/lerna.json
index b70ce1c0..08d0b783 100644
--- a/lerna.json
+++ b/lerna.json
@@ -1,6 +1,6 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
- "version": "3.0.1",
+ "version": "4.0.0-alpha.1",
"conventionalCommits": true,
"npmClient": "pnpm",
"changelog": true,
diff --git a/package.json b/package.json
index 439481ad..d4484d08 100644
--- a/package.json
+++ b/package.json
@@ -10,11 +10,18 @@
"start": "pnpm dev"
},
"pnpm": {
- "overrides": {
- "ember-concurrency": "4.0.2"
- },
+ "onlyBuiltDependencies": [
+ "core-js",
+ "core-js-pure",
+ "edgedriver",
+ "esbuild",
+ "geckodriver",
+ "lefthook",
+ "msw",
+ "nx"
+ ],
"patchedDependencies": {
- "lerna": "patches/lerna.patch"
+ "@embroider/vite": "patches/@embroider__vite.patch"
}
},
"repository": {
@@ -25,11 +32,11 @@
"git-conventional-commits": "catalog:",
"lefthook": "catalog:",
"lerna": "catalog:",
- "turbo": "^2.3.0"
+ "turbo": "^2.7.6"
},
- "packageManager": "pnpm@9.12.3",
+ "packageManager": "pnpm@10.28.0",
"volta": {
- "node": "20.18.0",
- "pnpm": "9.12.3"
+ "node": "22.22.0",
+ "pnpm": "10.28.0"
}
}
\ No newline at end of file
diff --git a/packages/.DS_Store b/packages/.DS_Store
index b678a966..0f4e3cb3 100644
Binary files a/packages/.DS_Store and b/packages/.DS_Store differ
diff --git a/packages/ember-input-validation/.eslintrc.cjs b/packages/ember-input-validation/.eslintrc.cjs
deleted file mode 100644
index f3b9ec36..00000000
--- a/packages/ember-input-validation/.eslintrc.cjs
+++ /dev/null
@@ -1,49 +0,0 @@
-module.exports = {
- overrides: [
- {
- files: ['**/*.{js,ts}'],
- plugins: ['ember'],
- parser: '@typescript-eslint/parser',
- extends: [
- 'eslint:recommended',
- 'plugin:ember/recommended', // or other configuration
- ],
- rules: {
- // override / enable optional rules
- 'ember/no-replace-test-comments': 'error'
- }
- },
- {
- files: ['**/*.gts'],
- parser: 'ember-eslint-parser',
- plugins: ['ember'],
- extends: [
- 'eslint:recommended',
- 'plugin:@typescript-eslint/recommended',
- 'plugin:ember/recommended',
- 'plugin:ember/recommended-gts',
- ],
- rules: {
- // override / enable optional rules
- 'ember/no-at-ember-render-modifiers': 'warn'
- }
- },
- {
- files: ['**/*.gjs'],
- parser: 'ember-eslint-parser',
- plugins: ['ember'],
- extends: [
- 'eslint:recommended',
- 'plugin:ember/recommended',
- 'plugin:ember/recommended-gjs',
- ],
- },
- {
- files: ['tests/**/*.{js,ts,gjs,gts}'],
- rules: {
- // override / enable optional rules
- 'ember/no-replace-test-comments': 'error'
- }
- },
- ],
-};
diff --git a/packages/ember-input-validation/.template-lintrc.cjs b/packages/ember-input-validation/.template-lintrc.cjs
deleted file mode 100644
index f35f61c7..00000000
--- a/packages/ember-input-validation/.template-lintrc.cjs
+++ /dev/null
@@ -1,5 +0,0 @@
-'use strict';
-
-module.exports = {
- extends: 'recommended',
-};
diff --git a/packages/ember-input-validation/.template-lintrc.mjs b/packages/ember-input-validation/.template-lintrc.mjs
new file mode 100644
index 00000000..589ce8f7
--- /dev/null
+++ b/packages/ember-input-validation/.template-lintrc.mjs
@@ -0,0 +1,3 @@
+export default {
+ extends: 'recommended',
+};
diff --git a/packages/ember-input-validation/CHANGELOG.md b/packages/ember-input-validation/CHANGELOG.md
index 45fd4355..6a81ba35 100644
--- a/packages/ember-input-validation/CHANGELOG.md
+++ b/packages/ember-input-validation/CHANGELOG.md
@@ -5,162 +5,104 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
## [3.0.1](https://github.com/TRIPTYK/ember-common-ui/compare/v3.0.0...v3.0.1) (2026-01-14)
-
### Features
-* add index as param for yield and give info if stack is open for button delete ([c25dda6](https://github.com/TRIPTYK/ember-common-ui/commit/c25dda67800d515d7b5208e421d90e7a95aa619c))
-
-
-
-
+- add index as param for yield and give info if stack is open for button delete ([c25dda6](https://github.com/TRIPTYK/ember-common-ui/commit/c25dda67800d515d7b5208e421d90e7a95aa619c))
# [3.0.0](https://github.com/TRIPTYK/ember-common-ui/compare/v3.0.0-alpha.13...v3.0.0) (2025-04-18)
-
### Features
-* onDelete for file-list prefab ([4a252e7](https://github.com/TRIPTYK/ember-common-ui/commit/4a252e749adffd96fe47f3362dda67fc7bd499f4))
-
-
-
-
+- onDelete for file-list prefab ([4a252e7](https://github.com/TRIPTYK/ember-common-ui/commit/4a252e749adffd96fe47f3362dda67fc7bd499f4))
# [3.0.0-alpha.13](https://github.com/TRIPTYK/ember-common-ui/compare/v3.0.0-alpha.12...v3.0.0-alpha.13) (2025-02-03)
**Note:** Version bump only for package @triptyk/ember-input-validation
-
-
-
-
# [3.0.0-alpha.12](https://github.com/TRIPTYK/ember-common-ui/compare/v3.0.0-alpha.11...v3.0.0-alpha.12) (2025-01-27)
**Note:** Version bump only for package @triptyk/ember-input-validation
-
-
-
-
# [3.0.0-alpha.11](https://github.com/TRIPTYK/ember-common-ui/compare/v3.0.0-alpha.10...v3.0.0-alpha.11) (2025-01-24)
-
### Bug Fixes
-* adapt disabled view for file-list ([613ca0c](https://github.com/TRIPTYK/ember-common-ui/commit/613ca0ce7cdb4f3cd9bc8733ff9602d95fd789ce))
-* add condition around window.open in case of fastboot ([26102f5](https://github.com/TRIPTYK/ember-common-ui/commit/26102f5db27787af36293e919eb73c192cceccdf))
-* password input eye should be focusable by keyboard ([e6778dc](https://github.com/TRIPTYK/ember-common-ui/commit/e6778dc7f029e8d07258f0756b4789ca1e17e664))
-
+- adapt disabled view for file-list ([613ca0c](https://github.com/TRIPTYK/ember-common-ui/commit/613ca0ce7cdb4f3cd9bc8733ff9602d95fd789ce))
+- add condition around window.open in case of fastboot ([26102f5](https://github.com/TRIPTYK/ember-common-ui/commit/26102f5db27787af36293e919eb73c192cceccdf))
+- password input eye should be focusable by keyboard ([e6778dc](https://github.com/TRIPTYK/ember-common-ui/commit/e6778dc7f029e8d07258f0756b4789ca1e17e664))
### Features
-* add prefab file list with dropzone ([25be9d1](https://github.com/TRIPTYK/ember-common-ui/commit/25be9d13385cf4b3a4938a5f652b9365bc79fbf2))
-* add prefab file list with dropzone ([d9b682c](https://github.com/TRIPTYK/ember-common-ui/commit/d9b682cc725b5c536513795f5abf5dcf039a0000))
-
-
-
-
+- add prefab file list with dropzone ([25be9d1](https://github.com/TRIPTYK/ember-common-ui/commit/25be9d13385cf4b3a4938a5f652b9365bc79fbf2))
+- add prefab file list with dropzone ([d9b682c](https://github.com/TRIPTYK/ember-common-ui/commit/d9b682cc725b5c536513795f5abf5dcf039a0000))
# [3.0.0-alpha.10](https://github.com/TRIPTYK/ember-common-ui/compare/v3.0.0-alpha.9...v3.0.0-alpha.10) (2024-12-06)
**Note:** Version bump only for package @triptyk/ember-input-validation
-
-
-
-
# [3.0.0-alpha.9](https://github.com/TRIPTYK/ember-common-ui/compare/v3.0.0-alpha.8...v3.0.0-alpha.9) (2024-12-06)
-
### Bug Fixes
-* adapt type for datepicker & radio group ([f626c73](https://github.com/TRIPTYK/ember-common-ui/commit/f626c73ec629c73db0a978e71afa550c5abceee6))
-
-
-
-
+- adapt type for datepicker & radio group ([f626c73](https://github.com/TRIPTYK/ember-common-ui/commit/f626c73ec629c73db0a978e71afa550c5abceee6))
# [3.0.0-alpha.8](https://github.com/TRIPTYK/ember-common-ui/compare/v3.0.0-alpha.7...v3.0.0-alpha.8) (2024-12-06)
-
### Bug Fixes
-* add optional onChange on prefab ([661b0e7](https://github.com/TRIPTYK/ember-common-ui/commit/661b0e774809fa83907a2e7acfc0d146cfda6de4))
-* css file for datepicker icon ([909c051](https://github.com/TRIPTYK/ember-common-ui/commit/909c05139f7966f799b800a7db6c70e8df858e69))
-* remove value in changeset when value is empty ([18bff1c](https://github.com/TRIPTYK/ember-common-ui/commit/18bff1cdab182563281462b7f0f14478ce50bc04))
-
-
-
-
+- add optional onChange on prefab ([661b0e7](https://github.com/TRIPTYK/ember-common-ui/commit/661b0e774809fa83907a2e7acfc0d146cfda6de4))
+- css file for datepicker icon ([909c051](https://github.com/TRIPTYK/ember-common-ui/commit/909c05139f7966f799b800a7db6c70e8df858e69))
+- remove value in changeset when value is empty ([18bff1c](https://github.com/TRIPTYK/ember-common-ui/commit/18bff1cdab182563281462b7f0f14478ce50bc04))
# [3.0.0-alpha.7](https://github.com/TRIPTYK/ember-common-ui/compare/v3.0.0-alpha.6...v3.0.0-alpha.7) (2024-12-05)
-
### Bug Fixes
-* add ...attributes on the right element ([fb73825](https://github.com/TRIPTYK/ember-common-ui/commit/fb738250f90effd1220466eb6aeec6673c58638c))
-* add css for prefab password error ([54b6141](https://github.com/TRIPTYK/ember-common-ui/commit/54b61413173f81eef117ccd2183fef75ab183c5e))
-* add tabindex=-1 on button show/hide password ([897bdc9](https://github.com/TRIPTYK/ember-common-ui/commit/897bdc97cd28ff72375e4747ea8b0d2451d0294f))
-
-
-
-
+- add ...attributes on the right element ([fb73825](https://github.com/TRIPTYK/ember-common-ui/commit/fb738250f90effd1220466eb6aeec6673c58638c))
+- add css for prefab password error ([54b6141](https://github.com/TRIPTYK/ember-common-ui/commit/54b61413173f81eef117ccd2183fef75ab183c5e))
+- add tabindex=-1 on button show/hide password ([897bdc9](https://github.com/TRIPTYK/ember-common-ui/commit/897bdc97cd28ff72375e4747ea8b0d2451d0294f))
# [3.0.0-alpha.6](https://github.com/TRIPTYK/ember-common-ui/compare/v3.0.0-alpha.5...v3.0.0-alpha.6) (2024-12-05)
-
### Bug Fixes
-* bic, iban & vat return uppercase automaticly ([8c8cd3b](https://github.com/TRIPTYK/ember-common-ui/commit/8c8cd3b080dd5126c7fb55a0f5c5d62976867a0d))
-
-
-
-
+- bic, iban & vat return uppercase automaticly ([8c8cd3b](https://github.com/TRIPTYK/ember-common-ui/commit/8c8cd3b080dd5126c7fb55a0f5c5d62976867a0d))
# [3.0.0-alpha.5](https://github.com/TRIPTYK/ember-common-ui/compare/v3.0.0-alpha.3...v3.0.0-alpha.5) (2024-12-03)
**Note:** Version bump only for package @triptyk/ember-input-validation
-
-
-
-
# [3.0.0-alpha.4](https://github.com/TRIPTYK/ember-common-ui/compare/v3.0.0-alpha.3...v3.0.0-alpha.4) (2024-12-03)
**Note:** Version bump only for package @triptyk/ember-input-validation
-
-
-
-
# [3.0.0-alpha.3](https://github.com/TRIPTYK/ember-common-ui/compare/v3.0.0-alpha.2...v3.0.0-alpha.3) (2024-12-03)
-
### Bug Fixes
-* add omit value and onChange in type for datepicker and radio ([8da1526](https://github.com/TRIPTYK/ember-common-ui/commit/8da1526642f18ce3c05a3823d9266f6706f709dc))
-* make good for a11y and let just one theme to build faster daisy ([9de5e05](https://github.com/TRIPTYK/ember-common-ui/commit/9de5e05b1adcef966658d53527e77b9b85b34854))
-* mobile number is not reset when change other input in form ([23566a4](https://github.com/TRIPTYK/ember-common-ui/commit/23566a496b8a68961947d33cebd8eaf115d4c6d3))
-* remove ...attributes duplicate ([527336b](https://github.com/TRIPTYK/ember-common-ui/commit/527336b205e35c0a86c06e6784369547b889995e))
-* use displayValue of mask instead of value ([4a3953a](https://github.com/TRIPTYK/ember-common-ui/commit/4a3953a28e6398a88db24b8617bc37d7f57a6aca))
-
+- add omit value and onChange in type for datepicker and radio ([8da1526](https://github.com/TRIPTYK/ember-common-ui/commit/8da1526642f18ce3c05a3823d9266f6706f709dc))
+- make good for a11y and let just one theme to build faster daisy ([9de5e05](https://github.com/TRIPTYK/ember-common-ui/commit/9de5e05b1adcef966658d53527e77b9b85b34854))
+- mobile number is not reset when change other input in form ([23566a4](https://github.com/TRIPTYK/ember-common-ui/commit/23566a496b8a68961947d33cebd8eaf115d4c6d3))
+- remove ...attributes duplicate ([527336b](https://github.com/TRIPTYK/ember-common-ui/commit/527336b205e35c0a86c06e6784369547b889995e))
+- use displayValue of mask instead of value ([4a3953a](https://github.com/TRIPTYK/ember-common-ui/commit/4a3953a28e6398a88db24b8617bc37d7f57a6aca))
### Features
-* add daisyui ([fce98a6](https://github.com/TRIPTYK/ember-common-ui/commit/fce98a6d2d3aee0f864088193a3f21dcdafa0d88))
-* add default design with daisy for mobile prefab and add right class on prefab mobile ([a7f3a7b](https://github.com/TRIPTYK/ember-common-ui/commit/a7f3a7bc5bf5deb7cff451c3d9e8843b86828f7e))
-* add default design with daisy for select create prefab ([68bd7a4](https://github.com/TRIPTYK/ember-common-ui/commit/68bd7a4a5dc61edc34a7fba7ca6f534a6ddd44c6))
-* add default design with daisy for select prefab ([dc5d513](https://github.com/TRIPTYK/ember-common-ui/commit/dc5d513e3603deecaf549986b1bdb1af54b159c5))
-* add default design with daisy for select search prefab ([041eb36](https://github.com/TRIPTYK/ember-common-ui/commit/041eb36afc138fda0d8bc9f40052b78d56c2cb46))
-* add prefab for datepicker ([bb4875c](https://github.com/TRIPTYK/ember-common-ui/commit/bb4875c53b6e82ad5890f99b851ed4c5d7d336c7))
-* daisy on date picker range and currency ([654a5ac](https://github.com/TRIPTYK/ember-common-ui/commit/654a5ac31f8a566bd88de9a8d84295b5413fcaea))
-* daisy on email, file and iban prefab ([7daea16](https://github.com/TRIPTYK/ember-common-ui/commit/7daea16d8ac59fed1af944ca3890c9ded5ebd924))
-* daisyUI checkbox and input ([f095aa4](https://github.com/TRIPTYK/ember-common-ui/commit/f095aa4fe4520d5c5ccb5224b05e84345ab1f5d3))
-* daisyui for integer input ([57de733](https://github.com/TRIPTYK/ember-common-ui/commit/57de733126c6802a87df375d2d8f3a3415d979d2))
-* daisyui input number ([65b37ad](https://github.com/TRIPTYK/ember-common-ui/commit/65b37ade0ba9ec06408e3d0d00f2d31f583559a7))
-* daisyui national number prefab ([1b3df89](https://github.com/TRIPTYK/ember-common-ui/commit/1b3df895c231e01c33568dbeb126234dd6e58bb1))
-* daisyUI on prefab bic ([4e26577](https://github.com/TRIPTYK/ember-common-ui/commit/4e265774f9cad0bad5ea5902b6085ebe02e7f8c0))
-* daisyui radio-group prefab ([dae07b6](https://github.com/TRIPTYK/ember-common-ui/commit/dae07b60948852da9770d37de13a1086dc06d289))
-* input vat ([d1b1c38](https://github.com/TRIPTYK/ember-common-ui/commit/d1b1c3810fda38b106721d8fa984bdfa5da16fe4))
-* prefab password daisyui ([61e0be5](https://github.com/TRIPTYK/ember-common-ui/commit/61e0be57c55170d72210ba44e928d6d6616f598b))
-* remove classless feature ([dfed3d7](https://github.com/TRIPTYK/ember-common-ui/commit/dfed3d7226288bc84824f72f8f69174380604d97))
-* textarea prefab daisyui ([6bb6a22](https://github.com/TRIPTYK/ember-common-ui/commit/6bb6a222873142584439dcd5aa6e5cebfd2c86e5))
+- add daisyui ([fce98a6](https://github.com/TRIPTYK/ember-common-ui/commit/fce98a6d2d3aee0f864088193a3f21dcdafa0d88))
+- add default design with daisy for mobile prefab and add right class on prefab mobile ([a7f3a7b](https://github.com/TRIPTYK/ember-common-ui/commit/a7f3a7bc5bf5deb7cff451c3d9e8843b86828f7e))
+- add default design with daisy for select create prefab ([68bd7a4](https://github.com/TRIPTYK/ember-common-ui/commit/68bd7a4a5dc61edc34a7fba7ca6f534a6ddd44c6))
+- add default design with daisy for select prefab ([dc5d513](https://github.com/TRIPTYK/ember-common-ui/commit/dc5d513e3603deecaf549986b1bdb1af54b159c5))
+- add default design with daisy for select search prefab ([041eb36](https://github.com/TRIPTYK/ember-common-ui/commit/041eb36afc138fda0d8bc9f40052b78d56c2cb46))
+- add prefab for datepicker ([bb4875c](https://github.com/TRIPTYK/ember-common-ui/commit/bb4875c53b6e82ad5890f99b851ed4c5d7d336c7))
+- daisy on date picker range and currency ([654a5ac](https://github.com/TRIPTYK/ember-common-ui/commit/654a5ac31f8a566bd88de9a8d84295b5413fcaea))
+- daisy on email, file and iban prefab ([7daea16](https://github.com/TRIPTYK/ember-common-ui/commit/7daea16d8ac59fed1af944ca3890c9ded5ebd924))
+- daisyUI checkbox and input ([f095aa4](https://github.com/TRIPTYK/ember-common-ui/commit/f095aa4fe4520d5c5ccb5224b05e84345ab1f5d3))
+- daisyui for integer input ([57de733](https://github.com/TRIPTYK/ember-common-ui/commit/57de733126c6802a87df375d2d8f3a3415d979d2))
+- daisyui input number ([65b37ad](https://github.com/TRIPTYK/ember-common-ui/commit/65b37ade0ba9ec06408e3d0d00f2d31f583559a7))
+- daisyui national number prefab ([1b3df89](https://github.com/TRIPTYK/ember-common-ui/commit/1b3df895c231e01c33568dbeb126234dd6e58bb1))
+- daisyUI on prefab bic ([4e26577](https://github.com/TRIPTYK/ember-common-ui/commit/4e265774f9cad0bad5ea5902b6085ebe02e7f8c0))
+- daisyui radio-group prefab ([dae07b6](https://github.com/TRIPTYK/ember-common-ui/commit/dae07b60948852da9770d37de13a1086dc06d289))
+- input vat ([d1b1c38](https://github.com/TRIPTYK/ember-common-ui/commit/d1b1c3810fda38b106721d8fa984bdfa5da16fe4))
+- prefab password daisyui ([61e0be5](https://github.com/TRIPTYK/ember-common-ui/commit/61e0be57c55170d72210ba44e928d6d6616f598b))
+- remove classless feature ([dfed3d7](https://github.com/TRIPTYK/ember-common-ui/commit/dfed3d7226288bc84824f72f8f69174380604d97))
+- textarea prefab daisyui ([6bb6a22](https://github.com/TRIPTYK/ember-common-ui/commit/6bb6a222873142584439dcd5aa6e5cebfd2c86e5))
diff --git a/packages/ember-input-validation/babel.config.cjs b/packages/ember-input-validation/babel.config.cjs
new file mode 100644
index 00000000..7b4df257
--- /dev/null
+++ b/packages/ember-input-validation/babel.config.cjs
@@ -0,0 +1,51 @@
+/**
+ * This babel.config is not used for publishing.
+ * It's only for the local editing experience
+ * (and linting)
+ */
+const { buildMacros } = require('@embroider/macros/babel');
+
+const {
+ babelCompatSupport,
+ templateCompatSupport,
+} = require('@embroider/compat/babel');
+
+const macros = buildMacros();
+
+// For scenario testing
+const isCompat = Boolean(process.env.ENABLE_COMPAT_BUILD);
+
+module.exports = {
+ plugins: [
+ ['ember-concurrency/async-arrow-task-transform', {}],
+ [
+ '@babel/plugin-transform-typescript',
+ {
+ allExtensions: true,
+ allowDeclareFields: true,
+ onlyRemoveTypeImports: true,
+ },
+ ],
+ [
+ 'babel-plugin-ember-template-compilation',
+ {
+ transforms: [
+ ...(isCompat ? templateCompatSupport() : macros.templateMacros),
+ ],
+ },
+ ],
+ [
+ 'module:decorator-transforms',
+ {
+ runtime: {
+ import: require.resolve('decorator-transforms/runtime-esm'),
+ },
+ },
+ ],
+ ...(isCompat ? babelCompatSupport() : macros.babelMacros),
+ ],
+
+ generatorOpts: {
+ compact: false,
+ },
+};
diff --git a/packages/ember-input-validation/babel.config.json b/packages/ember-input-validation/babel.config.json
deleted file mode 100644
index 6d0c9ac0..00000000
--- a/packages/ember-input-validation/babel.config.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "plugins": [
- ["@babel/plugin-transform-typescript", { "allExtensions": true, "onlyRemoveTypeImports": true, "allowDeclareFields": true }],
- "@embroider/addon-dev/template-colocation-plugin",
- "@babel/plugin-transform-class-static-block",
- ["babel-plugin-ember-template-compilation", {
- "targetFormat": "hbs",
- "transforms": []
- }],
- "ember-concurrency/async-arrow-task-transform",
- ["@babel/plugin-proposal-decorators", { "version": "legacy" }],
- "@babel/plugin-proposal-class-properties"
- ]
-}
diff --git a/packages/ember-input-validation/babel.publish.config.cjs b/packages/ember-input-validation/babel.publish.config.cjs
new file mode 100644
index 00000000..77646a6f
--- /dev/null
+++ b/packages/ember-input-validation/babel.publish.config.cjs
@@ -0,0 +1,37 @@
+/**
+ * This babel.config is only used for publishing.
+ *
+ * For local dev experience, see the babel.config
+ */
+module.exports = {
+ plugins: [
+ ['ember-concurrency/async-arrow-task-transform', {}],
+ [
+ '@babel/plugin-transform-typescript',
+ {
+ allExtensions: true,
+ allowDeclareFields: true,
+ onlyRemoveTypeImports: true,
+ },
+ ],
+ [
+ 'babel-plugin-ember-template-compilation',
+ {
+ targetFormat: 'hbs',
+ transforms: [],
+ },
+ ],
+ [
+ 'module:decorator-transforms',
+ {
+ runtime: {
+ import: 'decorator-transforms/runtime-esm',
+ },
+ },
+ ],
+ ],
+
+ generatorOpts: {
+ compact: false,
+ },
+};
diff --git a/packages/ember-input-validation/eslint.config.mjs b/packages/ember-input-validation/eslint.config.mjs
new file mode 100644
index 00000000..d4b289b6
--- /dev/null
+++ b/packages/ember-input-validation/eslint.config.mjs
@@ -0,0 +1,129 @@
+/**
+ * Debugging:
+ * https://eslint.org/docs/latest/use/configure/debug
+ * ----------------------------------------------------
+ *
+ * Print a file's calculated configuration
+ *
+ * npx eslint --print-config path/to/file.js
+ *
+ * Inspecting the config
+ *
+ * npx eslint --inspect-config
+ *
+ */
+import babelParser from '@babel/eslint-parser';
+import js from '@eslint/js';
+import { defineConfig, globalIgnores } from 'eslint/config';
+import prettier from 'eslint-config-prettier';
+import ember from 'eslint-plugin-ember/recommended';
+import importPlugin from 'eslint-plugin-import';
+import n from 'eslint-plugin-n';
+import globals from 'globals';
+import ts from 'typescript-eslint';
+
+const esmParserOptions = {
+ ecmaFeatures: { modules: true },
+ ecmaVersion: 'latest',
+};
+
+const tsParserOptions = {
+ projectService: true,
+ tsconfigRootDir: import.meta.dirname,
+};
+
+export default defineConfig([
+ globalIgnores(['dist/', 'dist-*/', 'declarations/', 'coverage/', '!**/.*']),
+ js.configs.recommended,
+ prettier,
+ ember.configs.base,
+ ember.configs.gjs,
+ ember.configs.gts,
+ /**
+ * https://eslint.org/docs/latest/use/configure/configuration-files#configuring-linter-options
+ */
+ {
+ linterOptions: {
+ reportUnusedDisableDirectives: 'error',
+ },
+ },
+ {
+ files: ['**/*.js'],
+ languageOptions: {
+ parser: babelParser,
+ },
+ },
+ {
+ files: ['**/*.{js,gjs}'],
+ languageOptions: {
+ parserOptions: esmParserOptions,
+ globals: {
+ ...globals.browser,
+ },
+ },
+ },
+ {
+ files: ['**/*.{ts,gts}'],
+ languageOptions: {
+ parser: ember.parser,
+ parserOptions: tsParserOptions,
+ globals: {
+ ...globals.browser,
+ },
+ },
+ extends: [
+ ...ts.configs.recommendedTypeChecked,
+ // https://github.com/ember-cli/ember-addon-blueprint/issues/119
+ {
+ ...ts.configs.eslintRecommended,
+ files: undefined,
+ },
+ ember.configs.gts,
+ ],
+ },
+ {
+ files: ['src/**/*'],
+ plugins: {
+ import: importPlugin,
+ },
+ rules: {
+ // require relative imports use full extensions
+ 'import/extensions': ['error', 'always', { ignorePackages: true }],
+ },
+ },
+ /**
+ * CJS node files
+ */
+ {
+ files: ['**/*.cjs'],
+ plugins: {
+ n,
+ },
+
+ languageOptions: {
+ sourceType: 'script',
+ ecmaVersion: 'latest',
+ globals: {
+ ...globals.node,
+ },
+ },
+ },
+ /**
+ * ESM node files
+ */
+ {
+ files: ['**/*.mjs'],
+ plugins: {
+ n,
+ },
+
+ languageOptions: {
+ sourceType: 'module',
+ ecmaVersion: 'latest',
+ parserOptions: esmParserOptions,
+ globals: {
+ ...globals.node,
+ },
+ },
+ },
+]);
diff --git a/packages/ember-input-validation/llm.txt b/packages/ember-input-validation/llm.txt
deleted file mode 100644
index 4a89ecba..00000000
--- a/packages/ember-input-validation/llm.txt
+++ /dev/null
@@ -1,367 +0,0 @@
-# @triptyk/ember-input-validation
-
-Form validation components for Ember using ember-immer-changeset and yup. Wraps @triptyk/ember-input components with validation capabilities.
-
-## Installation
-
-```bash
-ember install @triptyk/ember-input-validation
-```
-
-Install peer dependencies:
-
-```bash
-ember install @triptyk/ember-input
-ember install ember-immer-changeset
-```
-
-## Importing Types
-
-Add the Glint template-registry to your global.d.ts file:
-
-```ts
-import '@glint/environment-ember-loose';
-import type EmberInputValidationRegistry from '@triptyk/ember-input-validation/template-registry';
-
-declare module '@glint/environment-ember-loose/registry' {
- export default interface Registry
- extends EmberInputValidationRegistry {}
-}
-```
-
-## HTML Naming Conventions
-
-Every component has an HTML element with a class assigned to it. The naming follows this rule:
-
-**Path of the component to kebab case**
-
-Examples:
-- ``: .tpk-input
-- ``: .tpk-input-label
-
-Use the `@classless` argument to prevent the base class from being applied.
-
-## Core Concept
-
-All validation components work with ember-immer-changeset to manage form state and validation. They yield error information and integrate with yup validation schemas.
-
-## Components
-
-### TpkForm
-
-A form component that integrates ember-immer-changeset and yup for validation.
-
-**Usage:**
-```hbs
-
-
-
-
- {{#if I.errors}}
- {{#each I.errors as |error|}}
- {{error.message}}
- {{/each}}
- {{/if}}
-
- Submit
-
-```
-
-**Controller Setup:**
-```js
-import { ImmerChangeset } from 'ember-immer-changeset';
-import { object, string } from 'yup';
-
-export default class extends Controller {
- changeset = new ImmerChangeset({});
-
- validationSchema = object().shape({
- firstName: string().required().min(3),
- });
-
- @action
- success() {
- // Called when form is valid and submitted
- }
-}
-```
-
-**Arguments:**
-- `@changeset`: ImmerChangeset (required) - The changeset instance
-- `@onSubmit`: Function (required) - Called when form is valid and submitted
-- `@validationSchema`: Yup Object (required) - Yup validation schema
-- `@reactive`: Boolean (default: true) - Validate fields on change
-- `@executeOnValid`: Boolean (default: true) - Execute changeset if valid
-- `@disabled`: Boolean (default: false) - Disable form and inputs
-- `@removeErrorsOnSubmit`: Boolean (default: true) - Clear errors on submit
-- `@autoScrollOnError`: Boolean (default: true) - Scroll to first error on submit
-
-**Yielded Components (Base):**
-- `F.TpkInput` - TpkValidationInput
-- `F.TpkTextarea` - TpkValidationTextarea
-- `F.TpkSelect` - TpkValidationSelect
-- `F.TpkCheckbox` - TpkValidationCheckbox
-- `F.TpkRadio` - TpkValidationRadio
-- `F.TpkRadioGroup` - TpkValidationRadioGroup
-- `F.TpkFile` - TpkValidationFile
-- `F.TpkDatepicker` - TpkValidationDatePicker
-
-**Yielded Components (Prefabs):**
-Pre-styled components with built-in error display:
-- `F.TpkInputPrefab`
-- `F.TpkTextareaPrefab`
-- `F.TpkSelectPrefab`
-- `F.TpkSelectCreatePrefab`
-- `F.TpkSelectSearchPrefab`
-- `F.TpkCheckboxPrefab`
-- `F.TpkRadioPrefab`
-- `F.TpkRadioGroupPrefab`
-- `F.TpkDatepickerPrefab`
-- `F.TpkDatepickerRangePrefab`
-- `F.TpkTimepickerPrefab`
-
-**Yielded Components (Specialized Input Prefabs):**
-- `F.TpkPasswordPrefab` - Password input with toggle visibility
-- `F.TpkEmailPrefab` - Email input with validation
-- `F.TpkIbanPrefab` - IBAN input with formatting
-- `F.TpkBicPrefab` - BIC input with formatting
-- `F.TpkVatPrefab` - VAT number input
-- `F.TpkNationalNumberPrefab` - National number input
-- `F.TpkCurrencyPrefab` - Currency input with formatting
-- `F.TpkIntegerPrefab` - Integer number input
-- `F.TpkNumberPrefab` - Decimal number input
-- `F.TpkMobilePrefab` - Mobile phone input
-
-**Yielded Values:**
-- `changesetGet`: Function - Shortcut to changeset.get()
-- `requiredFields`: Array - List of required fields from schema
-
-**Customizing Default Components:**
-
-You can override the default components via the TpkForm service:
-
-```ts
-let tpkFormService = this.owner.lookup('service:tpk-form');
-tpkFormService.TpkInput = CustomInputComponent;
-tpkFormService.TpkInputPrefab = CustomInputPrefab;
-// etc.
-```
-
-### TpkValidationInput
-
-An input component with validation support.
-
-**Usage:**
-```hbs
-
-
-
- {{#each I.errors as |error|}}
- {{error.message}}
- {{/each}}
-
-```
-
-**Arguments:**
-- `@label`: String - Label text
-- `@validationField`: String (required) - Field name in changeset
-- `@onChange`: Function - Callback when value changes (receives value and event)
-- `@changeset`: ImmerChangeset (required) - Changeset instance
-- `@classless`: Boolean - Override default CSS classes
-- `@showTogglePasswordButton`: Boolean - Show password visibility toggle (for password inputs)
-- `@type`: String - Input type
-
-**Yields:**
-- `I.Label`: Label component
-- `I.Input`: Input component
-- `I.errors`: Array of error objects with message property
-- `I.hasError`: Boolean indicating if field has errors
-
-**CSS Classes:**
-- `.tpk-input`: Main container
-- `.tpk-input input`: Input element
-- `.tpk-input-label`: Label element
-- `[data-has-error="true"]`: Applied when field has errors
-- `[data-has-error="false"]`: Applied when field has no errors
-
-### TpkValidationCheckbox
-
-A checkbox component with validation support.
-
-**Usage:**
-```hbs
-
-
-
- {{#each T.errors as |error|}}
- {{error.message}}
- {{/each}}
-
-```
-
-**Arguments:**
-- `@label`: String - Label text
-- `@validationField`: String (required) - Field name in changeset
-- `@onChange`: Function - Callback when value changes (receives value and event)
-- `@changeset`: ImmerChangeset (required) - Changeset instance
-- `@classless`: Boolean - Override default CSS classes
-
-**Yields:**
-- `T.Label`: Label component
-- `T.Input`: Checkbox component
-- `T.errors`: Array of error objects
-- `T.hasError`: Boolean
-
-**CSS Classes:**
-- `.tpk-checkbox-input`: Main container
-- `.tpk-checkbox-label`: Label element
-- `[data-has-error="true"]`: Applied when field has errors
-- `[data-has-error="false"]`: Applied when field has no errors
-
-### TpkValidationTextarea
-
-A textarea component with validation support.
-
-**Arguments:**
-- `@label`: String - Label text
-- `@validationField`: String (required) - Field name in changeset
-- `@onChange`: Function - Callback when value changes
-- `@changeset`: ImmerChangeset (required) - Changeset instance
-- `@maxLength`: Number - Maximum character length
-- `@classless`: Boolean - Override default CSS classes
-
-**Yields:**
-Similar to TpkValidationInput with error support
-
-### TpkValidationSelect
-
-A select component with validation support.
-
-**Arguments:**
-- `@label`: String - Label text
-- `@validationField`: String (required) - Field name in changeset
-- `@onChange`: Function - Callback when selection changes
-- `@changeset`: ImmerChangeset (required) - Changeset instance
-- `@options`: Array - Options to display
-- `@multiple`: Boolean - Allow multiple selections
-- `@classless`: Boolean - Override default CSS classes
-
-**Yields:**
-Similar to TpkSelect with error support
-
-### TpkValidationRadio
-
-A radio input component with validation support.
-
-**Arguments:**
-- `@label`: String - Label text
-- `@validationField`: String (required) - Field name in changeset
-- `@onChange`: Function - Callback when selection changes
-- `@changeset`: ImmerChangeset (required) - Changeset instance
-- `@value`: String - Value of this radio option
-- `@name`: String - Group name
-- `@selected`: String - Currently selected value
-- `@classless`: Boolean - Override default CSS classes
-
-**Yields:**
-Similar to TpkRadio with error support
-
-### TpkValidationRadioGroup
-
-A radio group component with validation support for managing multiple radio buttons.
-
-**Arguments:**
-- `@validationField`: String (required) - Field name in changeset
-- `@changeset`: ImmerChangeset (required) - Changeset instance
-- `@groupLabel`: String - Label for the entire group
-- `@mandatory`: Boolean - Whether selection is required
-- `@classless`: Boolean - Override default CSS classes
-
-### TpkValidationFile
-
-A file input component with validation support.
-
-**Arguments:**
-- `@label`: String - Label text
-- `@validationField`: String (required) - Field name in changeset
-- `@onChange`: Function - Callback when files change
-- `@changeset`: ImmerChangeset (required) - Changeset instance
-- `@accept`: String - Accepted file types
-- `@multiple`: Boolean - Allow multiple file selection
-- `@classless`: Boolean - Override default CSS classes
-
-**Yields:**
-Similar to TpkFile with error support
-
-### TpkValidationDatePicker
-
-A date picker component with validation support.
-
-**Arguments:**
-- `@label`: String - Label text
-- `@validationField`: String (required) - Field name in changeset
-- `@onChange`: Function - Callback when date changes
-- `@changeset`: ImmerChangeset (required) - Changeset instance
-- Plus all TpkDatepicker arguments
-- `@classless`: Boolean - Override default CSS classes
-
-**Yields:**
-Similar to TpkDatepicker with error support
-
-## Validation Behavior
-
-- **On submit**: Entire form is validated when submitted
-- **On field change**: If `@reactive={{true}}` (default), fields validate individually on change
-- **Error display**: Errors are yielded and must be displayed in template
-- **Auto scroll**: If `@autoScrollOnError={{true}}` (default), scrolls to first error on submit
-- **Error clearing**: If `@removeErrorsOnSubmit={{true}}` (default), clears errors before validation on submit
-
-## Complete Example
-
-```hbs
-
-
-
-
-
-
-
-
-
- Submit
-
-```
-
-## Compatibility
-
-- Ember.js v4.8 or above
-- Embroider or ember-auto-import v2
-- Requires @triptyk/ember-input
-- Requires ember-immer-changeset
-
-## License
-
-MIT License
diff --git a/packages/ember-input-validation/package.json b/packages/ember-input-validation/package.json
index e2501e3d..98379993 100644
--- a/packages/ember-input-validation/package.json
+++ b/packages/ember-input-validation/package.json
@@ -1,6 +1,6 @@
{
"name": "@triptyk/ember-input-validation",
- "version": "3.0.1",
+ "version": "4.0.0-alpha.1",
"description": "This addon will give you an input in TailwindCSS with Ember",
"keywords": [
"ember-addon"
@@ -16,7 +16,7 @@
"types": "./declarations/*.d.ts",
"default": "./dist/*.js"
},
- "./app.css": "./dist/app.css",
+ "./dist/*.css": "./dist/*.css",
"./addon-main.js": "./addon-main.cjs"
},
"typesVersions": {
@@ -34,76 +34,83 @@
"llm.txt"
],
"scripts": {
- "build": "concurrently 'npm:build:js' 'npm:build:types'",
- "build:clean": "rm -rf dist",
- "build:js": "rollup --config",
- "build:types": "glint --declaration",
- "lint": "concurrently 'npm:lint:*(!fix)' --names 'lint:'",
- "lint:fix": "concurrently 'npm:lint:*:fix' --names 'fix:'",
+ "build": "rollup --config",
+ "build:watch": "rollup --config --watch",
+ "format": "prettier . --cache --write",
+ "lint": "concurrently \"pnpm:lint:*(!fix)\" --names \"lint:\" --prefixColors auto",
+ "lint:fix": "concurrently \"pnpm:lint:*:fix\" --names \"fix:\" --prefixColors auto && pnpm run format",
+ "lint:format": "prettier . --cache --check",
"lint:hbs": "ember-template-lint . --no-error-on-unmatched-pattern",
"lint:hbs:fix": "ember-template-lint . --fix --no-error-on-unmatched-pattern",
"lint:js": "eslint . --cache",
"lint:js:fix": "eslint . --fix",
- "lint:types": "glint",
- "prepack": "pnpm run build",
- "start": "concurrently 'npm:start:*'",
- "start:js": "rollup --config --watch --no-watch.clearScreen",
- "start:types": "glint --declaration --watch",
- "test": "echo 'A v2 addon does not have tests, run tests in test-app'"
+ "lint:types": "ember-tsc --noEmit",
+ "prepack": "rollup --config",
+ "test": "echo \"No tests specified\" && exit 0"
},
"dependencies": {
- "@babel/core": "^7.25.2",
"@embroider/addon-shim": "catalog:",
+ "@eonasdan/tempus-dominus": "catalog:",
"@glimmer/component": "catalog:",
"@glimmer/tracking": "catalog:",
- "ember-concurrency": "~4.0.2",
+ "decorator-transforms": "catalog:",
+ "ember-concurrency": "catalog:",
"ember-intl": "catalog:",
"ember-lifeline": "catalog:",
- "ember-modifier": "~4.1.0",
- "ember-test-selectors": "~6.0.0",
- "yup": "catalog:"
+ "ember-modifier": "catalog:",
+ "ember-power-select": "catalog:",
+ "ember-power-select-with-create": "catalog:",
+ "ember-strict-application-resolver": "catalog:",
+ "ember-test-selectors": "catalog:",
+ "zod": "catalog:"
},
"devDependencies": {
- "@babel/core": "^7.17.0",
+ "@babel/core": "catalog:",
+ "@babel/eslint-parser": "catalog:",
"@babel/plugin-proposal-class-properties": "catalog:",
"@babel/plugin-proposal-decorators": "catalog:",
"@babel/plugin-transform-class-static-block": "catalog:",
"@babel/plugin-transform-typescript": "catalog:",
"@babel/runtime": "catalog:",
+ "@ember/app-tsconfig": "catalog:",
+ "@ember/library-tsconfig": "catalog:",
"@embroider/addon-dev": "catalog:",
- "@glint/core": "catalog:",
- "@glint/environment-ember-loose": "catalog:",
- "@glint/environment-ember-template-imports": "catalog:",
+ "@embroider/core": "catalog:",
+ "@eslint/js": "catalog:",
+ "@glint/ember-tsc": "catalog:",
"@glint/template": "catalog:",
"@rollup/plugin-babel": "catalog:",
+ "@rollup/plugin-image": "^3.0.3",
"@rollup/plugin-node-resolve": "catalog:",
"@triptyk/ember-input": "workspace:*",
"@tsconfig/ember": "catalog:",
- "@typescript-eslint/eslint-plugin": "catalog:",
- "@typescript-eslint/parser": "catalog:",
+ "@types/node": "catalog:",
"babel-plugin-ember-template-compilation": "catalog:",
"concurrently": "catalog:",
"ember-immer-changeset": "catalog:",
- "ember-source": "~5.12.0",
+ "ember-source": "catalog:",
"ember-template-imports": "catalog:",
- "ember-template-lint": "^5.13.0",
- "eslint": "^8.57.0",
+ "ember-template-lint": "~7.9.3",
+ "eslint": "catalog:",
"eslint-config-prettier": "catalog:",
- "eslint-plugin-ember": "^12.1.1",
+ "eslint-plugin-ember": "catalog:",
+ "eslint-plugin-import": "catalog:",
"eslint-plugin-n": "catalog:",
"eslint-plugin-prettier": "catalog:",
+ "globals": "catalog:",
+ "postcss-import": "^16.1.1",
"prettier": "catalog:",
"prettier-plugin-ember-template-tag": "catalog:",
"rollup": "catalog:",
"rollup-plugin-copy": "catalog:",
- "rollup-plugin-glimmer-template-tag": "catalog:",
- "rollup-plugin-import-css": "^3.5.7",
+ "rollup-plugin-import-css": "^4.2.0",
"rollup-plugin-postcss": "^4.0.2",
"rollup-plugin-ts": "catalog:",
"rsvp": "catalog:",
"type-fest": "catalog:",
- "typescript": "^5.5.4",
- "webpack": "^5.95.0"
+ "typescript": "~5.9.3",
+ "typescript-eslint": "catalog:",
+ "vite": "catalog:"
},
"publishConfig": {
"registry": "https://registry.npmjs.org"
@@ -170,7 +177,7 @@
"peerDependencies": {
"@triptyk/ember-input": "workspace:*",
"ember-immer-changeset": "^1.0.2",
- "ember-source": ">=5.0.0"
+ "ember-source": ">=6.0.0"
},
"gitHead": "0e3c997a40d084fa5eb05fe7cfd042bda3de4789"
}
diff --git a/packages/ember-input-validation/rollup.config.mjs b/packages/ember-input-validation/rollup.config.mjs
index 74bcd57e..478c9289 100644
--- a/packages/ember-input-validation/rollup.config.mjs
+++ b/packages/ember-input-validation/rollup.config.mjs
@@ -1,75 +1,101 @@
-import babel from '@rollup/plugin-babel';
-import copy from 'rollup-plugin-copy';
+import { babel } from '@rollup/plugin-babel';
import { Addon } from '@embroider/addon-dev/rollup';
+import { fileURLToPath } from 'node:url';
+import { resolve, dirname } from 'node:path';
+import postcss from 'rollup-plugin-postcss';
+import postcssImport from 'postcss-import';
+import image from '@rollup/plugin-image';
const addon = new Addon({
srcDir: 'src',
destDir: 'dist',
});
-export default {
- // This provides defaults that work well alongside `publicEntrypoints` below.
- // You can augment this if you need to.
- output: addon.output(),
+const rootDirectory = dirname(fileURLToPath(import.meta.url));
+const babelConfig = resolve(rootDirectory, './babel.publish.config.cjs');
+const tsConfig = resolve(rootDirectory, './tsconfig.publish.json');
- plugins: [
- // These are the modules that users should be able to import from your
- // addon. Anything not listed here may get optimized away.
- // By default all your JavaScript modules (**/*.js) will be importable.
- // But you are encouraged to tweak this to only cover the modules that make
- // up your addon's public API. Also make sure your package.json#exports
- // is aligned to the config here.
- // See https://github.com/embroider-build/embroider/blob/main/docs/v2-faq.md#how-can-i-define-the-public-exports-of-my-addon
- addon.publicEntrypoints(['**/*.js', 'index.js', 'template-registry.js', 'form-registry.js']),
+export default [
+ {
+ // This provides defaults that work well alongside `publicEntrypoints` below.
+ // You can augment this if you need to.
+ output: addon.output(),
+ plugins: [
+ image(),
+ // These are the modules that users should be able to import from your
+ // addon. Anything not listed here may get optimized away.
+ // By default all your JavaScript modules (**/*.js) will be importable.
+ // But you are encouraged to tweak this to only cover the modules that make
+ // up your addon's public API. Also make sure your package.json#exports
+ // is aligned to the config here.
+ // See https://github.com/embroider-build/embroider/blob/main/docs/v2-faq.md#how-can-i-define-the-public-exports-of-my-addon
+ addon.publicEntrypoints(['**/*.js', 'index.js', 'template-registry.js']),
- // These are the modules that should get reexported into the traditional
- // "app" tree. Things in here should also be in publicEntrypoints above, but
- // not everything in publicEntrypoints necessarily needs to go here.
- addon.appReexports([
- 'components/**/*.js',
- 'helpers/**/*.js',
- 'modifiers/**/*.js',
- 'services/**/*.js',
- 'form-registry.js',
- ]),
+ // These are the modules that should get reexported into the traditional
+ // "app" tree. Things in here should also be in publicEntrypoints above, but
+ // not everything in publicEntrypoints necessarily needs to go here.
+ addon.appReexports([
+ 'components/**/*.js',
+ 'helpers/**/*.js',
+ 'modifiers/**/*.js',
+ 'services/**/*.js',
+ ]),
- // Follow the V2 Addon rules about dependencies. Your code can import from
- // `dependencies` and `peerDependencies` as well as standard Ember-provided
- // package names.
- addon.dependencies(),
+ // Follow the V2 Addon rules about dependencies. Your code can import from
+ // `dependencies` and `peerDependencies` as well as standard Ember-provided
+ // package names.
+ addon.dependencies(),
- // This babel config should *not* apply presets or compile away ES modules.
- // It exists only to provide development niceties for you, like automatic
- // template colocation.
- //
- // By default, this will load the actual babel config from the file
- // babel.config.json.
- // glimmerTemplateTag(),
+ // This babel config should *not* apply presets or compile away ES modules.
+ // It exists only to provide development niceties for you, like automatic
+ // template colocation.
+ //
+ // By default, this will load the actual babel config from the file
+ // babel.config.json.
+ babel({
+ extensions: ['.js', '.gjs', '.ts', '.gts'],
+ babelHelpers: 'bundled',
+ configFile: babelConfig,
+ }),
- babel({
- extensions: ['.js', '.gjs', '.ts', '.gts'],
- babelHelpers: 'bundled',
- }),
+ // Ensure that standalone .hbs files are properly integrated as Javascript.
+ addon.hbs(),
- // Ensure that standalone .hbs files are properly integrated as Javascript.
- addon.hbs(),
+ // Ensure that .gjs files are properly integrated as Javascript
+ addon.gjs(),
- // Ensure that .gjs files are properly integrated as Javascript
- addon.gjs(),
+ // Emit .d.ts declaration files
+ addon.declarations(
+ 'declarations',
+ `pnpm ember-tsc --declaration --project ${tsConfig}`,
+ ),
- // addons are allowed to contain imports of .css files, which we want rollup
- // to leave alone and keep in the published output.
- addon.keepAssets(['**/*.css']),
-
- // Remove leftover build artifacts when starting a new build.
- addon.clean(),
-
- // Copy Readme and License into published package
- copy({
- targets: [
- { src: '../README.md', dest: '.' },
- { src: '../LICENSE.md', dest: '.' },
- ],
- }),
- ],
-};
+ // Remove leftover build artifacts when starting a new build.
+ addon.clean(),
+ ],
+ },
+ {
+ input: 'src/app.css',
+ output: {
+ dir: 'dist',
+ assetFileNames: '[name][extname]',
+ },
+ plugins: [
+ postcss({
+ extract: 'app.css',
+ minimize: false,
+ plugins: [postcssImport({})],
+ }),
+ {
+ name: 'remove-css-js-entry',
+ generateBundle(_, bundle) {
+ for (const file of Object.keys(bundle)) {
+ if (bundle[file].type === 'chunk') {
+ delete bundle[file];
+ }
+ }
+ },
+ },
+ ],
+ },
+];
diff --git a/packages/ember-input-validation/src/app.css b/packages/ember-input-validation/src/app.css
index cc61a012..ad33c630 100644
--- a/packages/ember-input-validation/src/app.css
+++ b/packages/ember-input-validation/src/app.css
@@ -1,3 +1,4 @@
+@import url('@eonasdan/tempus-dominus/dist/css/tempus-dominus.css');
@import url('./components/prefabs/styles/tpk-checkbox.css');
@import url('./components/prefabs/styles/tpk-textarea.css');
@import url('./components/prefabs/styles/tpk-input.css');
diff --git a/doc-app/public/assets/icons/eye-shut.svg b/packages/ember-input-validation/src/assets/eye-shut.svg
similarity index 100%
rename from doc-app/public/assets/icons/eye-shut.svg
rename to packages/ember-input-validation/src/assets/eye-shut.svg
diff --git a/doc-app/public/assets/icons/eye.svg b/packages/ember-input-validation/src/assets/eye.svg
similarity index 100%
rename from doc-app/public/assets/icons/eye.svg
rename to packages/ember-input-validation/src/assets/eye.svg
diff --git a/packages/ember-input-validation/src/components/base.ts b/packages/ember-input-validation/src/components/base.ts
index 876d571f..4faa189e 100644
--- a/packages/ember-input-validation/src/components/base.ts
+++ b/packages/ember-input-validation/src/components/base.ts
@@ -2,6 +2,7 @@ import { assert } from '@ember/debug';
import Component from '@glimmer/component';
import { type Changeset } from 'ember-immer-changeset';
import { isFieldError } from '../utils/is-field-error.ts';
+import type Owner from '@ember/owner';
export interface BaseValidationSignature {
Args: {
@@ -18,13 +19,14 @@ export interface BaseValidationSignature {
export abstract class BaseValidationComponent<
T extends BaseValidationSignature,
> extends Component {
- constructor(owner: unknown, args: T['Args']) {
+ constructor(owner: Owner, args: T['Args']) {
super(owner, args);
assert('@changeset is required', typeof args.changeset === 'object');
assert(
'@validationField is required',
typeof args.validationField === 'string',
);
+ // assert(`@validationField ${args.validationField} is not in changeset. Please at least set it to undefined.`, args.validationField in args.changeset.data);
}
get hasError() {
@@ -51,7 +53,7 @@ export abstract class BaseValidationComponent<
get errors(): Record[] {
return (
this.args.changeset.errors.filter((err) =>
- isFieldError(this.args.validationField, err.key as string),
+ isFieldError(this.args.validationField, err.key),
) ?? []
);
}
diff --git a/packages/ember-input-validation/src/components/prefabs/mandatory-label.gts b/packages/ember-input-validation/src/components/prefabs/mandatory-label.gts
index 655ef733..c04f5421 100644
--- a/packages/ember-input-validation/src/components/prefabs/mandatory-label.gts
+++ b/packages/ember-input-validation/src/components/prefabs/mandatory-label.gts
@@ -8,15 +8,16 @@ export interface MandatoryLabelComponentSignature {
Element: HTMLSpanElement;
}
-const MandatoryLabelComponent: TOC =
+const MandatoryLabelComponent: TOC =
+
- {{@label}}
- {{#if @mandatory}}
- *
- {{/if}}
+ {{@label}}
+ {{#if @mandatory}}
+ *
+ {{/if}}
- ;
+ ;
export default MandatoryLabelComponent;
diff --git a/packages/ember-input-validation/src/components/prefabs/styles/tpk-bic.css b/packages/ember-input-validation/src/components/prefabs/styles/tpk-bic.css
index fab88861..14281605 100644
--- a/packages/ember-input-validation/src/components/prefabs/styles/tpk-bic.css
+++ b/packages/ember-input-validation/src/components/prefabs/styles/tpk-bic.css
@@ -1,23 +1,23 @@
.tpk-bic-container {
- @apply form-control relative pb-4;
+ @apply fieldset relative pb-4;
}
.tpk-bic-container .tpk-bic-input {
- @apply input input-bordered;
+ @apply input;
}
.tpk-bic-container .tpk-label {
@apply label;
}
-.tpk-bic-container[data-has-error~="true"] .tpk-bic-input {
+.tpk-bic-container[data-has-error~='true'] .tpk-bic-input {
@apply input-error text-error;
}
-.tpk-bic-container[data-has-error~="true"] .tpk-label {
+.tpk-bic-container[data-has-error~='true'] .tpk-label {
@apply text-error label;
}
-.tpk-bic-container[data-has-error~="true"] .tpk-validation-errors {
- @apply text-error text-sm justify-self-end right-0 -bottom-1 absolute;
+.tpk-bic-container[data-has-error~='true'] .tpk-validation-errors {
+ @apply text-error text-xs justify-self-end right-0 bottom-0 absolute;
}
diff --git a/packages/ember-input-validation/src/components/prefabs/styles/tpk-checkbox.css b/packages/ember-input-validation/src/components/prefabs/styles/tpk-checkbox.css
index f1b02ecc..4ebe65fa 100644
--- a/packages/ember-input-validation/src/components/prefabs/styles/tpk-checkbox.css
+++ b/packages/ember-input-validation/src/components/prefabs/styles/tpk-checkbox.css
@@ -1,5 +1,5 @@
.tpk-checkbox-container {
- @apply form-control relative pb-4;
+ @apply fieldset relative pb-4;
}
.tpk-checkbox-container .tpk-label {
@@ -10,14 +10,14 @@
@apply checkbox checkbox-primary;
}
-.tpk-checkbox-container[data-has-error~="true"] .tpk-checkbox-input {
+.tpk-checkbox-container[data-has-error~='true'] .tpk-checkbox-input {
@apply checkbox checkbox-error;
}
-.tpk-checkbox-container[data-has-error~="true"] .tpk-label {
+.tpk-checkbox-container[data-has-error~='true'] .tpk-label {
@apply text-error label;
}
-.tpk-checkbox-container[data-has-error~="true"] .tpk-validation-errors {
- @apply text-error text-sm justify-self-end absolute -bottom-1;
+.tpk-checkbox-container[data-has-error~='true'] .tpk-validation-errors {
+ @apply text-error text-xs justify-self-end absolute bottom-0;
}
diff --git a/packages/ember-input-validation/src/components/prefabs/styles/tpk-currency.css b/packages/ember-input-validation/src/components/prefabs/styles/tpk-currency.css
index 5ce7d55f..34ac5f5d 100644
--- a/packages/ember-input-validation/src/components/prefabs/styles/tpk-currency.css
+++ b/packages/ember-input-validation/src/components/prefabs/styles/tpk-currency.css
@@ -1,5 +1,5 @@
.tpk-currency-container {
- @apply form-control relative pb-4;
+ @apply fieldset relative pb-4;
}
.tpk-currency-container .tpk-label {
@@ -7,22 +7,21 @@
}
.tpk-currency-input {
- @apply input input-bordered;
+ @apply input;
}
-.tpk-currency-container[data-has-error~="true"] .tpk-currency-input {
+.tpk-currency-container[data-has-error~='true'] .tpk-currency-input {
@apply input-error;
}
-.tpk-currency-container[data-has-error~="true"]
-.tpk-validation-errors {
- @apply text-error text-sm justify-self-end right-0 -bottom-1 absolute;
+.tpk-currency-container[data-has-error~='true'] .tpk-validation-errors {
+ @apply text-error text-xs justify-self-end right-0 bottom-0 absolute;
}
-.tpk-currency-container[data-has-error~="true"] .tpk-label{
+.tpk-currency-container[data-has-error~='true'] .tpk-label {
@apply label text-error;
}
-.tpk-currency-container[data-has-error~="true"] .tpk-currency-input {
+.tpk-currency-container[data-has-error~='true'] .tpk-currency-input {
@apply text-error;
}
diff --git a/packages/ember-input-validation/src/components/prefabs/styles/tpk-datepicker-icon.css b/packages/ember-input-validation/src/components/prefabs/styles/tpk-datepicker-icon.css
index b1c8b439..5dd0f036 100644
--- a/packages/ember-input-validation/src/components/prefabs/styles/tpk-datepicker-icon.css
+++ b/packages/ember-input-validation/src/components/prefabs/styles/tpk-datepicker-icon.css
@@ -1,9 +1,16 @@
.tempus-dominus-widget.dark .icon {
background-color: white;
+ @apply w-4 h-4 flex;
+}
+
+.tempus-dominus-widget .calendar-header .next,
+.tempus-dominus-widget .calendar-header .previous {
+ @apply w-full h-full flex justify-center items-center;
}
.tempus-dominus-widget.light .icon {
background-color: black;
+ @apply w-4 h-4 flex;
}
.icon-calendar {
diff --git a/packages/ember-input-validation/src/components/prefabs/styles/tpk-datepicker-range.css b/packages/ember-input-validation/src/components/prefabs/styles/tpk-datepicker-range.css
index 6aac1452..c85a756a 100644
--- a/packages/ember-input-validation/src/components/prefabs/styles/tpk-datepicker-range.css
+++ b/packages/ember-input-validation/src/components/prefabs/styles/tpk-datepicker-range.css
@@ -7,7 +7,7 @@
}
.tpk-datepicker-range-container .tpk-datepicker-range-input {
- @apply input input-bordered w-full;
+ @apply input w-full;
}
.tpk-datepicker-range-container[data-has-error~='true']
@@ -16,7 +16,7 @@
}
.tpk-datepicker-range-container[data-has-error~='true'] .tpk-validation-errors {
- @apply text-error text-sm justify-self-end right-0 -bottom-1 absolute;
+ @apply text-error text-xs justify-self-end right-0 bottom-0 absolute;
}
.tpk-datepicker-range-container[data-has-error~='true'] .tpk-label {
diff --git a/packages/ember-input-validation/src/components/prefabs/styles/tpk-datepicker.css b/packages/ember-input-validation/src/components/prefabs/styles/tpk-datepicker.css
index 96cd73c9..26fb5f67 100644
--- a/packages/ember-input-validation/src/components/prefabs/styles/tpk-datepicker.css
+++ b/packages/ember-input-validation/src/components/prefabs/styles/tpk-datepicker.css
@@ -7,7 +7,7 @@
}
.tpk-datepicker-container .tpk-datepicker-input {
- @apply input input-bordered w-full;
+ @apply input w-full;
}
.tpk-datepicker-container[data-has-error~='true'] .tpk-datepicker-input {
@@ -15,7 +15,7 @@
}
.tpk-datepicker-container[data-has-error~='true'] .tpk-validation-errors {
- @apply text-error text-sm justify-self-end right-0 -bottom-1 absolute;
+ @apply text-error text-xs justify-self-end right-0 bottom-0 absolute;
}
.tpk-datepicker-container[data-has-error~='true'] .tpk-label {
diff --git a/packages/ember-input-validation/src/components/prefabs/styles/tpk-email.css b/packages/ember-input-validation/src/components/prefabs/styles/tpk-email.css
index c24d88ec..86a9f390 100644
--- a/packages/ember-input-validation/src/components/prefabs/styles/tpk-email.css
+++ b/packages/ember-input-validation/src/components/prefabs/styles/tpk-email.css
@@ -1,5 +1,5 @@
.tpk-email-container {
- @apply form-control relative pb-5;
+ @apply fieldset relative pb-5;
}
.tpk-email-container .tpk-label {
@@ -7,22 +7,21 @@
}
.tpk-email-input {
- @apply input input-bordered;
+ @apply input;
}
-.tpk-email-container[data-has-error~="true"] .tpk-email-input {
+.tpk-email-container[data-has-error~='true'] .tpk-email-input {
@apply input-error;
}
-.tpk-email-container[data-has-error~="true"]
-.tpk-validation-errors {
- @apply text-error text-sm justify-self-end right-0 -bottom-1 absolute;
+.tpk-email-container[data-has-error~='true'] .tpk-validation-errors {
+ @apply text-error text-xs justify-self-end right-0 bottom-0 absolute;
}
-.tpk-email-container[data-has-error~="true"] .tpk-label{
+.tpk-email-container[data-has-error~='true'] .tpk-label {
@apply label text-error;
}
-.tpk-email-container[data-has-error~="true"] .tpk-email-input {
+.tpk-email-container[data-has-error~='true'] .tpk-email-input {
@apply text-error;
}
diff --git a/packages/ember-input-validation/src/components/prefabs/styles/tpk-file-list.css b/packages/ember-input-validation/src/components/prefabs/styles/tpk-file-list.css
index c64a708d..e8fa17cb 100644
--- a/packages/ember-input-validation/src/components/prefabs/styles/tpk-file-list.css
+++ b/packages/ember-input-validation/src/components/prefabs/styles/tpk-file-list.css
@@ -44,7 +44,7 @@
}
.tpk-file-list-container[data-has-error~='true'] .tpk-validation-errors {
- @apply text-error text-sm absolute right-0 -bottom-1;
+ @apply text-error text-xs absolute right-0 bottom-0;
}
/* File list */
diff --git a/packages/ember-input-validation/src/components/prefabs/styles/tpk-file.css b/packages/ember-input-validation/src/components/prefabs/styles/tpk-file.css
index 1dbf4546..c3a1f7b0 100644
--- a/packages/ember-input-validation/src/components/prefabs/styles/tpk-file.css
+++ b/packages/ember-input-validation/src/components/prefabs/styles/tpk-file.css
@@ -1,5 +1,5 @@
.tpk-file-container {
- @apply form-control relative pb-4 w-full;
+ @apply fieldset relative pb-4 w-full;
}
.tpk-file-container .tpk-label {
@@ -7,26 +7,26 @@
}
.tpk-file-input {
- @apply file-input file-input-bordered w-full;
+ @apply file-input w-full;
}
-.tpk-file-container[data-has-error~="true"] .tpk-file-input {
+.tpk-file-container[data-has-error~='true'] .tpk-file-input {
@apply input-error;
}
-.tpk-file-container[data-has-error~="true"]
-.tpk-validation-errors {
- @apply text-error text-sm justify-self-end right-0 -bottom-1 absolute;
+.tpk-file-container[data-has-error~='true'] .tpk-validation-errors {
+ @apply text-error text-xs justify-self-end right-0 bottom-0 absolute;
}
-.tpk-file-container[data-has-error~="true"] .tpk-label{
+.tpk-file-container[data-has-error~='true'] .tpk-label {
@apply label text-error;
}
-.tpk-file-container[data-has-error~="true"] .tpk-file-input {
+.tpk-file-container[data-has-error~='true'] .tpk-file-input {
@apply text-error;
}
-.tpk-file-container[data-has-error~="true"] .tpk-file-input::file-selector-button {
+.tpk-file-container[data-has-error~='true']
+ .tpk-file-input::file-selector-button {
@apply bg-red-100 border border-none text-error;
}
diff --git a/packages/ember-input-validation/src/components/prefabs/styles/tpk-iban.css b/packages/ember-input-validation/src/components/prefabs/styles/tpk-iban.css
index 9db2a14c..2c6752ca 100644
--- a/packages/ember-input-validation/src/components/prefabs/styles/tpk-iban.css
+++ b/packages/ember-input-validation/src/components/prefabs/styles/tpk-iban.css
@@ -1,5 +1,5 @@
.tpk-iban-container {
- @apply form-control relative pb-4;
+ @apply fieldset relative pb-4;
}
.tpk-iban-container .tpk-label {
@@ -7,22 +7,21 @@
}
.tpk-iban-input {
- @apply input input-bordered;
+ @apply input;
}
-.tpk-iban-container[data-has-error~="true"] .tpk-iban-input {
+.tpk-iban-container[data-has-error~='true'] .tpk-iban-input {
@apply input-error;
}
-.tpk-iban-container[data-has-error~="true"]
-.tpk-validation-errors {
- @apply text-error text-sm justify-self-end right-0 -bottom-1 absolute;
+.tpk-iban-container[data-has-error~='true'] .tpk-validation-errors {
+ @apply text-error text-xs justify-self-end right-0 bottom-0 absolute;
}
-.tpk-iban-container[data-has-error~="true"] .tpk-label{
+.tpk-iban-container[data-has-error~='true'] .tpk-label {
@apply label text-error;
}
-.tpk-iban-container[data-has-error~="true"] .tpk-iban-input {
+.tpk-iban-container[data-has-error~='true'] .tpk-iban-input {
@apply text-error;
}
diff --git a/packages/ember-input-validation/src/components/prefabs/styles/tpk-input.css b/packages/ember-input-validation/src/components/prefabs/styles/tpk-input.css
index 087be94d..e28a314a 100644
--- a/packages/ember-input-validation/src/components/prefabs/styles/tpk-input.css
+++ b/packages/ember-input-validation/src/components/prefabs/styles/tpk-input.css
@@ -1,5 +1,5 @@
.tpk-input-container {
- @apply form-control relative pb-4;
+ @apply fieldset relative pb-4;
}
.tpk-input-container .tpk-label {
@@ -7,18 +7,17 @@
}
.tpk-input-input {
- @apply input input-bordered;
+ @apply input;
}
-.tpk-input-container[data-has-error~="true"] > .tpk-input-input {
+.tpk-input-container[data-has-error~='true'] > .tpk-input-input {
@apply input-error text-error;
}
-.tpk-input-container[data-has-error~="true"]
-.tpk-validation-errors {
- @apply text-error text-sm justify-self-end right-0 -bottom-1 absolute;
+.tpk-input-container[data-has-error~='true'] .tpk-validation-errors {
+ @apply text-error text-xs justify-self-end right-0 bottom-0 absolute;
}
-.tpk-input-container[data-has-error~="true"] .tpk-label {
+.tpk-input-container[data-has-error~='true'] .tpk-label {
@apply text-error label;
}
diff --git a/packages/ember-input-validation/src/components/prefabs/styles/tpk-integer.css b/packages/ember-input-validation/src/components/prefabs/styles/tpk-integer.css
index ab926536..f89a6e34 100644
--- a/packages/ember-input-validation/src/components/prefabs/styles/tpk-integer.css
+++ b/packages/ember-input-validation/src/components/prefabs/styles/tpk-integer.css
@@ -1,5 +1,5 @@
.tpk-integer-container {
- @apply form-control relative pb-4;
+ @apply fieldset relative pb-4;
}
.tpk-integer-container .tpk-label {
@@ -7,18 +7,17 @@
}
.tpk-integer-input {
- @apply input input-bordered;
+ @apply input;
}
-.tpk-integer-container[data-has-error~="true"] > .tpk-integer-input {
+.tpk-integer-container[data-has-error~='true'] > .tpk-integer-input {
@apply input-error text-error;
}
-.tpk-integer-container[data-has-error~="true"]
-.tpk-validation-errors {
- @apply text-error text-sm justify-self-end right-0 -bottom-1 absolute;
+.tpk-integer-container[data-has-error~='true'] .tpk-validation-errors {
+ @apply text-error text-xs justify-self-end right-0 bottom-0 absolute;
}
-.tpk-integer-container[data-has-error~="true"] .tpk-label {
+.tpk-integer-container[data-has-error~='true'] .tpk-label {
@apply text-error label;
}
diff --git a/packages/ember-input-validation/src/components/prefabs/styles/tpk-mobile.css b/packages/ember-input-validation/src/components/prefabs/styles/tpk-mobile.css
index dc52fee5..df5f8443 100644
--- a/packages/ember-input-validation/src/components/prefabs/styles/tpk-mobile.css
+++ b/packages/ember-input-validation/src/components/prefabs/styles/tpk-mobile.css
@@ -7,7 +7,7 @@
}
.tpk-mobile-input {
- @apply input input-bordered w-full;
+ @apply input w-full;
}
.tpk-mobile-content {
@@ -15,16 +15,16 @@
}
.tpk-mobile-content .ember-basic-dropdown-trigger {
- @apply input input-bordered pr-10 !rounded-lg;
+ @apply input pr-10 !rounded-lg;
}
-.tpk-mobile-content .ember-basic-dropdown-trigger[aria-disabled="true"] {
+.tpk-mobile-content .ember-basic-dropdown-trigger[aria-disabled='true'] {
cursor: not-allowed;
--tw-border-opacity: 1;
border-color: var(--fallback-b2, oklch(var(--b2) / var(--tw-border-opacity)));
--tw-bg-opacity: 1;
background-color: var(--fallback-b2, oklch(var(--b2) / var(--tw-bg-opacity)));
- color: var(--fallback-bc, oklch(var(--bc) / .4));
+ color: var(--fallback-bc, oklch(var(--bc) / 0.4));
}
.tpk-mobile-content .ember-power-select-selected-item {
@@ -32,30 +32,35 @@
}
.tpk-mobile-content .ember-basic-dropdown-content {
- @apply rounded-lg mt-2.5 z-[100];
- --tw-bg-opacity: 1;
- border-color: var(--fallback-bc, oklch(var(--bc) / 0.2));
- background-color: var(--fallback-b1, oklch(var(--b1) / var(--tw-bg-opacity)));
+ @apply absolute mt-2.5 z-[100];
+ max-width: 100%;
}
-.tpk-mobile-container .ember-basic-dropdown-trigger .flag, .tpk-mobile-container .ember-power-select-option .flag {
+.tpk-mobile-container .ember-basic-dropdown-trigger .flag,
+.tpk-mobile-container .ember-power-select-option .flag {
@apply flex items-center space-x-2;
}
-.tpk-mobile-container[data-has-error~="true"] > .tpk-text-input {
+.tpk-mobile-container[data-has-error~='true'] > .tpk-text-input {
@apply input-error text-error;
}
-.tpk-mobile-container[data-has-error~="true"]
-.tpk-validation-errors {
- @apply text-error text-sm justify-self-end right-0 absolute;
+.tpk-mobile-container[data-has-error~='true'] .tpk-validation-errors {
+ @apply text-error text-xs justify-self-end right-0 bottom-0 absolute;
}
-.tpk-mobile-container[data-has-error~="true"] .tpk-mobile-input {
+.tpk-mobile-container[data-has-error~='true'] .tpk-mobile-input {
@apply input-error text-error;
}
-.tpk-mobile-container[data-has-error~="true"] .tpk-label {
+.tpk-mobile-container[data-has-error~='true'] .tpk-label {
@apply text-error label;
}
+.tpk-mobile-container .ember-power-select-visually-hidden {
+ height: 1px;
+ left: -9999px;
+ overflow: hidden;
+ position: absolute;
+ width: 1px;
+}
diff --git a/packages/ember-input-validation/src/components/prefabs/styles/tpk-national-number.css b/packages/ember-input-validation/src/components/prefabs/styles/tpk-national-number.css
index 06043fb3..e326ede2 100644
--- a/packages/ember-input-validation/src/components/prefabs/styles/tpk-national-number.css
+++ b/packages/ember-input-validation/src/components/prefabs/styles/tpk-national-number.css
@@ -1,5 +1,5 @@
.tpk-national-number-container {
- @apply form-control relative pb-4;
+ @apply fieldset relative pb-4;
}
.tpk-national-number-container .tpk-label {
@@ -7,22 +7,23 @@
}
.tpk-national-number-input {
- @apply input input-bordered;
+ @apply input;
}
-.tpk-national-number-container[data-has-error~="true"] .tpk-national-number-input {
+.tpk-national-number-container[data-has-error~='true']
+ .tpk-national-number-input {
@apply input-error;
}
-.tpk-national-number-container[data-has-error~="true"]
-.tpk-validation-errors {
- @apply text-error text-sm justify-self-end right-0 -bottom-1 absolute;
+.tpk-national-number-container[data-has-error~='true'] .tpk-validation-errors {
+ @apply text-error text-xs justify-self-end right-0 bottom-0 absolute;
}
-.tpk-national-number-container[data-has-error~="true"] .tpk-label{
+.tpk-national-number-container[data-has-error~='true'] .tpk-label {
@apply label text-error;
}
-.tpk-national-number-container[data-has-error~="true"] .tpk-national-number-input {
+.tpk-national-number-container[data-has-error~='true']
+ .tpk-national-number-input {
@apply text-error;
}
diff --git a/packages/ember-input-validation/src/components/prefabs/styles/tpk-number.css b/packages/ember-input-validation/src/components/prefabs/styles/tpk-number.css
index 22f00c88..c765a14b 100644
--- a/packages/ember-input-validation/src/components/prefabs/styles/tpk-number.css
+++ b/packages/ember-input-validation/src/components/prefabs/styles/tpk-number.css
@@ -1,5 +1,5 @@
.tpk-number-container {
- @apply form-control relative pb-4;
+ @apply fieldset relative pb-4;
}
.tpk-number-container .tpk-label {
@@ -7,18 +7,17 @@
}
.tpk-number-input {
- @apply input input-bordered;
+ @apply input;
}
-.tpk-number-container[data-has-error~="true"] > .tpk-number-input {
+.tpk-number-container[data-has-error~='true'] > .tpk-number-input {
@apply input-error text-error;
}
-.tpk-number-container[data-has-error~="true"]
-.tpk-validation-errors {
- @apply text-error text-sm justify-self-end right-0 -bottom-1 absolute;
+.tpk-number-container[data-has-error~='true'] .tpk-validation-errors {
+ @apply text-error text-xs justify-self-end right-0 bottom-0 absolute;
}
-.tpk-number-container[data-has-error~="true"] .tpk-label {
+.tpk-number-container[data-has-error~='true'] .tpk-label {
@apply text-error label;
}
diff --git a/packages/ember-input-validation/src/components/prefabs/styles/tpk-password.css b/packages/ember-input-validation/src/components/prefabs/styles/tpk-password.css
index 16b0f61d..07554f6b 100644
--- a/packages/ember-input-validation/src/components/prefabs/styles/tpk-password.css
+++ b/packages/ember-input-validation/src/components/prefabs/styles/tpk-password.css
@@ -1,5 +1,5 @@
.tpk-password-container {
- @apply form-control relative pb-4;
+ @apply fieldset relative pb-4;
}
.tpk-password-container .tpk-label {
@@ -11,7 +11,7 @@
}
.tpk-password-input-container {
- @apply input input-bordered flex;
+ @apply input flex;
}
.tpk-password-input {
@@ -23,7 +23,7 @@
}
.tpk-password-container[data-has-error~='true'] .tpk-validation-errors {
- @apply text-error text-sm justify-self-end right-0 -bottom-1 absolute;
+ @apply text-error text-xs justify-self-end right-0 bottom-0 absolute;
}
.tpk-password-container[data-has-error~='true'] .tpk-label {
diff --git a/packages/ember-input-validation/src/components/prefabs/styles/tpk-radio-group.css b/packages/ember-input-validation/src/components/prefabs/styles/tpk-radio-group.css
index 4801614b..af05e8a5 100644
--- a/packages/ember-input-validation/src/components/prefabs/styles/tpk-radio-group.css
+++ b/packages/ember-input-validation/src/components/prefabs/styles/tpk-radio-group.css
@@ -1,16 +1,15 @@
.tpk-radio-group-container {
- @apply form-control relative pb-4;
+ @apply fieldset relative pb-4;
}
.tpk-radio-group-label {
- @apply label label-text text-base;
+ @apply label text-base;
}
-.tpk-radio-group-container[data-has-error~="true"]
-.tpk-validation-errors {
- @apply text-error text-sm justify-self-end right-0 -bottom-1 absolute;
+.tpk-radio-group-container[data-has-error~='true'] .tpk-validation-errors {
+ @apply text-error text-xs justify-self-end right-0 bottom-0 absolute;
}
-.tpk-radio-group-container[data-has-error~="true"] .tpk-radio-group-label {
+.tpk-radio-group-container[data-has-error~='true'] .tpk-radio-group-label {
@apply text-error label;
}
diff --git a/packages/ember-input-validation/src/components/prefabs/styles/tpk-radio.css b/packages/ember-input-validation/src/components/prefabs/styles/tpk-radio.css
index 325166f5..f606be20 100644
--- a/packages/ember-input-validation/src/components/prefabs/styles/tpk-radio.css
+++ b/packages/ember-input-validation/src/components/prefabs/styles/tpk-radio.css
@@ -1,5 +1,5 @@
.tpk-radio-container {
- @apply form-control;
+ @apply fieldset;
}
.tpk-radio-label {
@@ -7,7 +7,7 @@
}
.tpk-radio-label > span {
- @apply label-text;
+ @apply label;
}
.tpk-radio-input {
diff --git a/packages/ember-input-validation/src/components/prefabs/styles/tpk-select-create.css b/packages/ember-input-validation/src/components/prefabs/styles/tpk-select-create.css
index 29fb64d9..7a76f5cd 100644
--- a/packages/ember-input-validation/src/components/prefabs/styles/tpk-select-create.css
+++ b/packages/ember-input-validation/src/components/prefabs/styles/tpk-select-create.css
@@ -7,7 +7,7 @@
}
.tpk-select-create-container .ember-basic-dropdown-trigger {
- @apply input input-bordered pr-10 !rounded-lg flex items-center;
+ @apply input pr-10 !rounded-lg flex items-center;
}
.tpk-select-create-container
@@ -37,7 +37,7 @@
}
.tpk-select-create-container .ember-power-select-search input {
- @apply input input-bordered;
+ @apply input;
}
.tpk-select-create-container .ember-power-select-search input:focus-within {
@@ -45,15 +45,20 @@
}
.tpk-select-create-container .ember-basic-dropdown-content {
- @apply rounded-lg mt-2.5 z-[100];
- border-top: 1px solid var(--fallback-bc, oklch(var(--bc) / 0.2));
- --tw-bg-opacity: 1;
- border-color: var(--fallback-bc, oklch(var(--bc) / 0.2));
- background-color: var(--fallback-b1, oklch(var(--b1) / var(--tw-bg-opacity)));
+ @apply absolute mt-2.5 z-[100];
+ max-width: 100%;
+}
+
+.tpk-select-create-container .ember-power-select-visually-hidden {
+ height: 1px;
+ left: -9999px;
+ overflow: hidden;
+ position: absolute;
+ width: 1px;
}
.tpk-select-create-container[data-has-error~='true'] .tpk-validation-errors {
- @apply text-error text-sm justify-self-end right-0 absolute;
+ @apply text-error text-xs justify-self-end right-0 bottom-0 absolute;
}
.tpk-select-create-container[data-has-error~='true']
diff --git a/packages/ember-input-validation/src/components/prefabs/styles/tpk-select-search.css b/packages/ember-input-validation/src/components/prefabs/styles/tpk-select-search.css
index 812a8ac1..1878bd7f 100644
--- a/packages/ember-input-validation/src/components/prefabs/styles/tpk-select-search.css
+++ b/packages/ember-input-validation/src/components/prefabs/styles/tpk-select-search.css
@@ -7,7 +7,7 @@
}
.tpk-select-search-container .ember-basic-dropdown-trigger {
- @apply input input-bordered pr-10 !rounded-lg flex items-center;
+ @apply input pr-10 !rounded-lg flex items-center;
}
.tpk-select-search-container
@@ -33,7 +33,7 @@
}
.tpk-select-search-container .ember-power-select-search input {
- @apply input input-bordered;
+ @apply input;
}
.tpk-select-search-container .ember-power-select-search input:focus-within {
@@ -41,15 +41,20 @@
}
.tpk-select-search-container .ember-basic-dropdown-content {
- @apply rounded-lg mt-2.5 z-[100];
- border-top: 1px solid var(--fallback-bc, oklch(var(--bc) / 0.2));
- --tw-bg-opacity: 1;
- border-color: var(--fallback-bc, oklch(var(--bc) / 0.2));
- background-color: var(--fallback-b1, oklch(var(--b1) / var(--tw-bg-opacity)));
+ @apply absolute mt-2.5 z-[100];
+ max-width: 100%;
+}
+
+.tpk-select-search-container .ember-power-select-visually-hidden {
+ height: 1px;
+ left: -9999px;
+ overflow: hidden;
+ position: absolute;
+ width: 1px;
}
.tpk-select-search-container[data-has-error~='true'] .tpk-validation-errors {
- @apply text-error text-sm justify-self-end right-0 absolute;
+ @apply text-error text-xs justify-self-end right-0 bottom-0 absolute;
}
.tpk-select-search-container[data-has-error~='true']
diff --git a/packages/ember-input-validation/src/components/prefabs/styles/tpk-select.css b/packages/ember-input-validation/src/components/prefabs/styles/tpk-select.css
index a23a1c60..66d2d5d9 100644
--- a/packages/ember-input-validation/src/components/prefabs/styles/tpk-select.css
+++ b/packages/ember-input-validation/src/components/prefabs/styles/tpk-select.css
@@ -7,7 +7,7 @@
}
.tpk-select-container .ember-basic-dropdown-trigger {
- @apply input input-bordered pr-10 !rounded-lg;
+ @apply input pr-10 !rounded-lg;
}
.tpk-select-container .ember-basic-dropdown-trigger[aria-disabled='true'] {
@@ -32,15 +32,44 @@
}
.tpk-select-container .ember-basic-dropdown-content {
- @apply rounded-lg mt-2.5 z-[100];
- border-top: 1px solid var(--fallback-bc, oklch(var(--bc) / 0.2));
- --tw-bg-opacity: 1;
- border-color: var(--fallback-bc, oklch(var(--bc) / 0.2));
- background-color: var(--fallback-b1, oklch(var(--b1) / var(--tw-bg-opacity)));
+ @apply absolute mt-2.5 z-[100];
+ max-width: 100%;
+}
+
+.tpk-select-dropdown {
+ @apply flex flex-col rounded-box bg-base-100 py-2 pl-1.5 pr-2 shadow-sm min-w-52 max-h-60 overflow-y-auto;
+ box-shadow:
+ 0 1px 3px 0 oklch(0% 0 0 / 0.1),
+ 0 1px 2px -1px oklch(0% 0 0 / 0.1);
+}
+
+.tpk-select-dropdown .ember-power-select-options {
+ @apply flex flex-col flex-wrap gap-0 p-0 list-none;
+ font-size: 0.875rem;
+}
+
+.tpk-select-dropdown .ember-power-select-option {
+ @apply rounded-md grid grid-flow-col content-start items-center gap-2 pl-2 pr-2 py-1.5 text-start cursor-pointer outline-hidden;
+ transition-property: color, background-color, box-shadow;
+ transition-duration: 0.2s;
+ transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
+ grid-auto-columns: minmax(auto, max-content) auto max-content;
+}
+
+.tpk-select-dropdown .ember-power-select-option:hover {
+ @apply bg-base-content/10;
+ box-shadow:
+ 0 1px oklch(0% 0 0 / 0.01) inset,
+ 0 -1px oklch(100% 0 0 / 0.01) inset;
+}
+
+.tpk-select-dropdown .ember-power-select-option[aria-current='true'] {
+ color: var(--menu-active-fg, var(--color-neutral-content));
+ background-color: var(--menu-active-bg, var(--color-neutral));
}
.tpk-select-container[data-has-error~='true'] .tpk-validation-errors {
- @apply text-error text-sm justify-self-end right-0 absolute;
+ @apply text-error text-xs justify-self-end right-0 bottom-0 absolute;
}
.tpk-select-container[data-has-error~='true'] .ember-basic-dropdown-trigger {
@@ -50,3 +79,11 @@
.tpk-select-container[data-has-error~='true'] .tpk-label {
@apply text-error label;
}
+
+.tpk-select-container .ember-power-select-visually-hidden {
+ height: 1px;
+ left: -9999px;
+ overflow: hidden;
+ position: absolute;
+ width: 1px;
+}
diff --git a/packages/ember-input-validation/src/components/prefabs/styles/tpk-textarea.css b/packages/ember-input-validation/src/components/prefabs/styles/tpk-textarea.css
index d7c59b77..f26b7e97 100644
--- a/packages/ember-input-validation/src/components/prefabs/styles/tpk-textarea.css
+++ b/packages/ember-input-validation/src/components/prefabs/styles/tpk-textarea.css
@@ -1,5 +1,5 @@
.tpk-textarea-container {
- @apply form-control relative pb-6;
+ @apply fieldset relative pb-6;
}
.tpk-textarea-container .tpk-label {
@@ -7,22 +7,21 @@
}
.tpk-textarea-input {
- @apply textarea textarea-md input-bordered;
+ @apply textarea textarea-md;
}
-.tpk-textarea-container[data-has-error~="true"] > .tpk-textarea-input {
+.tpk-textarea-container[data-has-error~='true'] > .tpk-textarea-input {
@apply textarea-error text-error;
}
-.tpk-textarea-container[data-has-error~="true"]
-.tpk-validation-errors {
- @apply text-error text-sm justify-self-end right-0 -bottom-1 absolute;
+.tpk-textarea-container[data-has-error~='true'] .tpk-validation-errors {
+ @apply text-error text-xs justify-self-end right-0 bottom-0 absolute;
}
.tpk-textarea-container .tpk-textarea-character-count {
@apply justify-self-start left-0 -bottom-1 absolute text-sm;
}
-.tpk-textarea-container[data-has-error~="true"] .tpk-label {
+.tpk-textarea-container[data-has-error~='true'] .tpk-label {
@apply text-error label;
}
diff --git a/packages/ember-input-validation/src/components/prefabs/styles/tpk-timepicker.css b/packages/ember-input-validation/src/components/prefabs/styles/tpk-timepicker.css
index 48459d18..08102845 100644
--- a/packages/ember-input-validation/src/components/prefabs/styles/tpk-timepicker.css
+++ b/packages/ember-input-validation/src/components/prefabs/styles/tpk-timepicker.css
@@ -7,7 +7,7 @@
}
.tpk-timepicker-container .tpk-timepicker-input {
- @apply input input-bordered w-full;
+ @apply input w-full;
}
.tpk-timepicker-container[data-has-error~='true'] .tpk-timepicker-input {
@@ -15,7 +15,7 @@
}
.tpk-timepicker-container[data-has-error~='true'] .tpk-validation-errors {
- @apply text-error text-sm justify-self-end right-0 -bottom-1 absolute;
+ @apply text-error text-xs justify-self-end right-0 bottom-0 absolute;
}
.tpk-timepicker-container[data-has-error~='true'] .tpk-label {
diff --git a/packages/ember-input-validation/src/components/prefabs/styles/tpk-vat.css b/packages/ember-input-validation/src/components/prefabs/styles/tpk-vat.css
index 621b3be5..2f4c37d4 100644
--- a/packages/ember-input-validation/src/components/prefabs/styles/tpk-vat.css
+++ b/packages/ember-input-validation/src/components/prefabs/styles/tpk-vat.css
@@ -1,5 +1,5 @@
.tpk-vat-container {
- @apply form-control relative pb-4;
+ @apply fieldset relative pb-4;
}
.tpk-vat-container .tpk-label {
@@ -7,18 +7,17 @@
}
.tpk-vat-input {
- @apply input input-bordered;
+ @apply input;
}
-.tpk-vat-container[data-has-error~="true"] > .tpk-vat-input {
+.tpk-vat-container[data-has-error~='true'] > .tpk-vat-input {
@apply input-error text-error;
}
-.tpk-vat-container[data-has-error~="true"]
-.tpk-validation-errors {
- @apply text-error text-sm justify-self-end right-0 -bottom-1 absolute;
+.tpk-vat-container[data-has-error~='true'] .tpk-validation-errors {
+ @apply text-error text-xs justify-self-end right-0 bottom-0 absolute;
}
-.tpk-vat-container[data-has-error~="true"] .tpk-label {
+.tpk-vat-container[data-has-error~='true'] .tpk-label {
@apply text-error label;
}
diff --git a/packages/ember-input-validation/src/components/prefabs/tpk-validation-bic.gts b/packages/ember-input-validation/src/components/prefabs/tpk-validation-bic.gts
index 8e993a6b..df47b45b 100644
--- a/packages/ember-input-validation/src/components/prefabs/tpk-validation-bic.gts
+++ b/packages/ember-input-validation/src/components/prefabs/tpk-validation-bic.gts
@@ -1,14 +1,18 @@
-import TpkValidationInputComponent, { type TpkValidationInputComponentSignature } from "../tpk-validation-input.gts";
-import { type BaseValidationSignature } from "../base.ts";
-import { maskSpecialCharDefinition } from "../../utils/mask-utils.ts";
-import MandatoryLabelComponent from "./mandatory-label.gts";
-import Component from "@glimmer/component";
-import TpkValidationErrorsComponent from "./tpk-validation-errors.gts";
-import { action } from "@ember/object";
+import TpkValidationInputComponent, {
+ type TpkValidationInputComponentSignature,
+} from '../tpk-validation-input.gts';
+import { type BaseValidationSignature } from '../base.ts';
+import { maskSpecialCharDefinition } from '../../utils/mask-utils.ts';
+import MandatoryLabelComponent from './mandatory-label.gts';
+import Component from '@glimmer/component';
+import TpkValidationErrorsComponent from './tpk-validation-errors.gts';
+import { action } from '@ember/object';
-export interface TpkValidationBicPrefabSignature
- extends BaseValidationSignature {
- Args: Omit & {
+export interface TpkValidationBicPrefabSignature extends BaseValidationSignature {
+ Args: Omit<
+ TpkValidationInputComponentSignature['Args'],
+ 'type' | 'min' | 'max' | 'step' | 'mask' | 'maskOptions' | 'unmaskValue'
+ > & {
onChange?: (value: string, e: Event) => void;
};
Blocks: {
@@ -24,9 +28,9 @@ export default class TpkValidationBicPrefabComponent extends Component
-
-
-
-
+
+
+
+
-
+ />
+
}
diff --git a/packages/ember-input-validation/src/components/prefabs/tpk-validation-checkbox.gts b/packages/ember-input-validation/src/components/prefabs/tpk-validation-checkbox.gts
index d024b89b..0a19871c 100644
--- a/packages/ember-input-validation/src/components/prefabs/tpk-validation-checkbox.gts
+++ b/packages/ember-input-validation/src/components/prefabs/tpk-validation-checkbox.gts
@@ -1,19 +1,22 @@
-import TpkValidationCheckboxComponent, { type TpkValidationCheckboxComponentSignature } from "../tpk-validation-checkbox.gts";
-import { type BaseValidationSignature } from "../base.ts";
+import TpkValidationCheckboxComponent, {
+ type TpkValidationCheckboxComponentSignature,
+} from '../tpk-validation-checkbox.gts';
+import { type BaseValidationSignature } from '../base.ts';
import TpkValidationErrorsComponent from './tpk-validation-errors.gts';
-import MandatoryLabelComponent from "./mandatory-label.gts";
+import MandatoryLabelComponent from './mandatory-label.gts';
import { type TOC } from '@ember/component/template-only';
-export interface TpkValidationCheckboxPrefabSignature
- extends BaseValidationSignature {
- Args: BaseValidationSignature['Args'] & TpkValidationCheckboxComponentSignature['Args'];
+export interface TpkValidationCheckboxPrefabSignature extends BaseValidationSignature {
+ Args: BaseValidationSignature['Args'] &
+ TpkValidationCheckboxComponentSignature['Args'];
Blocks: {
default: [];
};
Element: HTMLElement;
}
-const TpkValidationCheckboxPrefabComponent: TOC =
+const TpkValidationCheckboxPrefabComponent: TOC =
+
-
+
-
-
-
-
-
+ ...attributes
+ data-test-tpk-prefab-checkbox-container={{@validationField}}
+ >
+
+
+
+
+
;
diff --git a/packages/ember-input-validation/src/components/prefabs/tpk-validation-currency.gts b/packages/ember-input-validation/src/components/prefabs/tpk-validation-currency.gts
index c57348bc..e4b257f5 100644
--- a/packages/ember-input-validation/src/components/prefabs/tpk-validation-currency.gts
+++ b/packages/ember-input-validation/src/components/prefabs/tpk-validation-currency.gts
@@ -6,18 +6,10 @@ import TpkValidationErrorsComponent from './tpk-validation-errors.gts';
import MandatoryLabelComponent from './mandatory-label.gts';
import Component from '@glimmer/component';
-export interface TpkValidationCurrencyPrefabSignature
- extends BaseValidationSignature {
+export interface TpkValidationCurrencyPrefabSignature extends BaseValidationSignature {
Args: Omit<
TpkValidationInputComponentSignature['Args'],
- | 'type'
- | 'mask'
- | 'unmaskValue'
- | 'maskOptions'
- | 'mask'
- | 'mix'
- | 'max'
- | 'step'
+ 'type' | 'mask' | 'unmaskValue' | 'maskOptions' | 'mix' | 'max' | 'step'
> & {
scale?: number;
};
@@ -65,8 +57,9 @@ export default class TpkValidationCurrencyPrefabComponent extends Component
diff --git a/packages/ember-input-validation/src/components/prefabs/tpk-validation-datepicker-range.gts b/packages/ember-input-validation/src/components/prefabs/tpk-validation-datepicker-range.gts
index 46cdf4bd..f55535ec 100644
--- a/packages/ember-input-validation/src/components/prefabs/tpk-validation-datepicker-range.gts
+++ b/packages/ember-input-validation/src/components/prefabs/tpk-validation-datepicker-range.gts
@@ -6,9 +6,9 @@ import { type BaseValidationSignature } from '../base.ts';
import { tracked } from '@glimmer/tracking';
import MandatoryLabelComponent from './mandatory-label.gts';
import Component from '@glimmer/component';
+import type Owner from '@ember/owner';
-export interface TpkValidationDatepickerRangePrefabSignature
- extends BaseValidationSignature {
+export interface TpkValidationDatepickerRangePrefabSignature extends BaseValidationSignature {
Args: Omit<
TpkValidationDatepickerComponentSignature['Args'],
| 'value'
@@ -34,7 +34,7 @@ export default class TpkValidationDatepickerRangePrefabComponent extends Compone
@tracked multipleDatesSeparator = ' - ';
constructor(
- owner: unknown,
+ owner: Owner,
args: TpkValidationDatepickerRangePrefabSignature['Args'],
) {
super(owner, args);
@@ -72,7 +72,7 @@ export default class TpkValidationDatepickerRangePrefabComponent extends Compone
>
diff --git a/packages/ember-input-validation/src/components/prefabs/tpk-validation-datepicker.gts b/packages/ember-input-validation/src/components/prefabs/tpk-validation-datepicker.gts
index 40820c93..8a3dd0a8 100644
--- a/packages/ember-input-validation/src/components/prefabs/tpk-validation-datepicker.gts
+++ b/packages/ember-input-validation/src/components/prefabs/tpk-validation-datepicker.gts
@@ -7,9 +7,9 @@ import { tracked } from '@glimmer/tracking';
import MandatoryLabelComponent from './mandatory-label.gts';
import Component from '@glimmer/component';
import { assert } from '@ember/debug';
+import type Owner from '@ember/owner';
-export interface TpkValidationDatepickerPrefabSignature
- extends BaseValidationSignature {
+export interface TpkValidationDatepickerPrefabSignature extends BaseValidationSignature {
Args: Omit<
TpkValidationDatepickerComponentSignature['Args'],
'value' | 'useCurrent'
@@ -26,7 +26,7 @@ export default class TpkValidationDatepickerPrefabComponent extends Component
;
Blocks: {
default: [];
@@ -27,7 +17,8 @@ export interface TpkValidationEmailComponentSignature
Element: HTMLElement;
}
-const TpkValidationEmailPrefabComponent: TOC
=
+const TpkValidationEmailPrefabComponent: TOC =
+
-
-
-
-
+
+
+
-
+ />
+
;
diff --git a/packages/ember-input-validation/src/components/prefabs/tpk-validation-errors.gts b/packages/ember-input-validation/src/components/prefabs/tpk-validation-errors.gts
index 8a9e3868..14f8c916 100644
--- a/packages/ember-input-validation/src/components/prefabs/tpk-validation-errors.gts
+++ b/packages/ember-input-validation/src/components/prefabs/tpk-validation-errors.gts
@@ -8,7 +8,6 @@ export interface TpkValidationErrorsComponentSignature {
Args: {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
errors: any;
-
};
Blocks: {
default: [];
@@ -24,19 +23,26 @@ export default class TpkValidationErrorsComponent extends Component {
- if (error.message) {
- const translationExists = this.intl.exists(error.message);
- return HS(translationExists ? this.intl.t(error.message) : error.message);
- }
- return error;
- });
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
+ return this.args.errors.map(
+ (error: { message: string; params: string[] }) => {
+ if (error.message) {
+ const translationExists = this.intl.exists(error.message);
+ return HS(
+ translationExists ? this.intl.t(error.message) : error.message,
+ );
+ }
+ return error;
+ },
+ );
}
-
+
{{#each this.errorMessages as |error|}}
{{#if error.message}}
diff --git a/packages/ember-input-validation/src/components/prefabs/tpk-validation-file-list.gts b/packages/ember-input-validation/src/components/prefabs/tpk-validation-file-list.gts
index 105092bf..76cde6ca 100644
--- a/packages/ember-input-validation/src/components/prefabs/tpk-validation-file-list.gts
+++ b/packages/ember-input-validation/src/components/prefabs/tpk-validation-file-list.gts
@@ -11,8 +11,7 @@ import type { Changeset } from 'ember-immer-changeset';
import { fn } from '@ember/helper';
import { modifier } from 'ember-modifier';
-export interface TpkValidationFileListPrefabSignature
- extends BaseValidationSignature {
+export interface TpkValidationFileListPrefabSignature extends BaseValidationSignature {
Args: BaseValidationSignature['Args'] &
TpkValidationFileComponentSignature['Args'] & {
mandatory?: boolean;
@@ -64,7 +63,7 @@ export default class TpkValidationFileListComponent extends Component 0) {
const files: File[] = Array.from(filesFromDrop);
@@ -98,8 +97,9 @@ export default class TpkValidationFileListComponent extends Component
@@ -173,7 +173,7 @@ export class FileListComponent extends Component {
this.args.changeset.set(this.args.validationField, updatedFiles);
}
- async downloadFile(file: File) {
+ downloadFile(file: File) {
if (window.open) {
window.open(URL.createObjectURL(file));
}
diff --git a/packages/ember-input-validation/src/components/prefabs/tpk-validation-file.gts b/packages/ember-input-validation/src/components/prefabs/tpk-validation-file.gts
index 0e855f43..de06dcf9 100644
--- a/packages/ember-input-validation/src/components/prefabs/tpk-validation-file.gts
+++ b/packages/ember-input-validation/src/components/prefabs/tpk-validation-file.gts
@@ -6,8 +6,7 @@ import TpkValidationFileComponent, {
type TpkValidationFileComponentSignature,
} from '../tpk-validation-file.gts';
-export interface TpkValidationFilePrefabSignature
- extends BaseValidationSignature {
+export interface TpkValidationFilePrefabSignature extends BaseValidationSignature {
Args: BaseValidationSignature['Args'] &
TpkValidationFileComponentSignature['Args'] & { mandatory?: boolean };
Blocks: {
@@ -32,8 +31,9 @@ const TpkValidationFilePrefabComponent: TOC =
diff --git a/packages/ember-input-validation/src/components/prefabs/tpk-validation-iban.gts b/packages/ember-input-validation/src/components/prefabs/tpk-validation-iban.gts
index d3c8c74b..bd12501f 100644
--- a/packages/ember-input-validation/src/components/prefabs/tpk-validation-iban.gts
+++ b/packages/ember-input-validation/src/components/prefabs/tpk-validation-iban.gts
@@ -1,14 +1,21 @@
-import TpkValidationInputComponent, { type TpkValidationInputComponentSignature } from "../tpk-validation-input.gts";
-import { type BaseValidationSignature } from "../base.ts";
-import { maskSpecialCharDefinition, getMaskForPrefixOrDefault } from "../../utils/mask-utils.ts";
+import TpkValidationInputComponent, {
+ type TpkValidationInputComponentSignature,
+} from '../tpk-validation-input.gts';
+import { type BaseValidationSignature } from '../base.ts';
+import {
+ maskSpecialCharDefinition,
+ getMaskForPrefixOrDefault,
+} from '../../utils/mask-utils.ts';
import TpkValidationErrorsComponent from './tpk-validation-errors.gts';
-import MandatoryLabelComponent from "./mandatory-label.gts";
-import Component from "@glimmer/component";
-import { action } from "@ember/object";
+import MandatoryLabelComponent from './mandatory-label.gts';
+import Component from '@glimmer/component';
+import { action } from '@ember/object';
-export interface TpkValidationIBANPrefabSignature
- extends BaseValidationSignature {
- Args: Omit & {
+export interface TpkValidationIBANPrefabSignature extends BaseValidationSignature {
+ Args: Omit<
+ TpkValidationInputComponentSignature['Args'],
+ 'type' | 'min' | 'max' | 'step' | 'mask' | 'maskOptions' | 'unmaskValue'
+ > & {
mandatory?: boolean;
onChange?: (value: string, e: Event) => void;
};
@@ -19,61 +26,67 @@ export interface TpkValidationIBANPrefabSignature
}
export default class TpkValidationIBANPrefabComponent extends Component {
- ibanMaskByCountry = [{
- mask: '$$&& &&&& &&&& &&&&',
- startsWith: 'BE',
- definitions: maskSpecialCharDefinition,
- lazy: false,
- },{
- mask: '$$&& &&&& &&&& &&$$ $$$$ $$$$ $&&',
- startsWith: 'FR',
- lazy: false,
- definitions: maskSpecialCharDefinition,
- },{
- mask: '$$&& &&&$ $$$$ $$$$ $$$$',
- startsWith: 'LU',
- definitions: maskSpecialCharDefinition,
- lazy: false,
- },{
- mask: '$$&& #### &&&& &&&& &&',
- startsWith: 'NL',
- definitions: maskSpecialCharDefinition,
- lazy: false,
- },{
- mask: '$$&& &&&& &&&& &&&& &&&& &&',
- definitions: maskSpecialCharDefinition,
- startsWith: 'DE',
- lazy: false,
- }, {
- mask: '##',
- startsWith: '',
- default: true,
- definitions: maskSpecialCharDefinition,
- lazy: false,
- }];
+ ibanMaskByCountry = [
+ {
+ mask: '$$&& &&&& &&&& &&&&',
+ startsWith: 'BE',
+ definitions: maskSpecialCharDefinition,
+ lazy: false,
+ },
+ {
+ mask: '$$&& &&&& &&&& &&$$ $$$$ $$$$ $&&',
+ startsWith: 'FR',
+ lazy: false,
+ definitions: maskSpecialCharDefinition,
+ },
+ {
+ mask: '$$&& &&&$ $$$$ $$$$ $$$$',
+ startsWith: 'LU',
+ definitions: maskSpecialCharDefinition,
+ lazy: false,
+ },
+ {
+ mask: '$$&& #### &&&& &&&& &&',
+ startsWith: 'NL',
+ definitions: maskSpecialCharDefinition,
+ lazy: false,
+ },
+ {
+ mask: '$$&& &&&& &&&& &&&& &&&& &&',
+ definitions: maskSpecialCharDefinition,
+ startsWith: 'DE',
+ lazy: false,
+ },
+ {
+ mask: '##',
+ startsWith: '',
+ default: true,
+ definitions: maskSpecialCharDefinition,
+ lazy: false,
+ },
+ ];
- maskOptions = {
+ maskOptions = {
dispatch: getMaskForPrefixOrDefault,
};
get hasMaskNotDisabled() {
- return this.args.disabled? '' : this.ibanMaskByCountry;
+ return this.args.disabled ? '' : this.ibanMaskByCountry;
}
@action
- onChange(value: string | number | Date | null, e: Event){
- const valueAsString = (value as string).toUpperCase()
- if(this.args.onChange){
+ onChange(value: string | number | Date | null, e: Event) {
+ const valueAsString = (value as string).toUpperCase();
+ if (this.args.onChange) {
return this.args.onChange(valueAsString, e);
}
return this.args.changeset.set(this.args.validationField, valueAsString);
}
-
-
-
-
-
+
+
+
+
-
+ />
+
}
diff --git a/packages/ember-input-validation/src/components/prefabs/tpk-validation-input.gts b/packages/ember-input-validation/src/components/prefabs/tpk-validation-input.gts
index bb182d1b..3d3dc079 100644
--- a/packages/ember-input-validation/src/components/prefabs/tpk-validation-input.gts
+++ b/packages/ember-input-validation/src/components/prefabs/tpk-validation-input.gts
@@ -1,13 +1,16 @@
-import TpkValidationInputComponent, { type TpkValidationInputComponentSignature } from "../tpk-validation-input.gts";
-import { type BaseValidationSignature } from "../base.ts";
+import TpkValidationInputComponent, {
+ type TpkValidationInputComponentSignature,
+} from '../tpk-validation-input.gts';
+import { type BaseValidationSignature } from '../base.ts';
import TpkValidationErrorsComponent from './tpk-validation-errors.gts';
-import { assert } from "@ember/debug";
-import MandatoryLabelComponent from "./mandatory-label.gts";
-import Component from "@glimmer/component";
+import { assert } from '@ember/debug';
+import MandatoryLabelComponent from './mandatory-label.gts';
+import Component from '@glimmer/component';
+import type Owner from '@ember/owner';
-export interface TpkValidationInputPrefabSignature
- extends BaseValidationSignature {
- Args: BaseValidationSignature['Args'] & TpkValidationInputComponentSignature['Args'];
+export interface TpkValidationInputPrefabSignature extends BaseValidationSignature {
+ Args: BaseValidationSignature['Args'] &
+ TpkValidationInputComponentSignature['Args'];
Blocks: {
default: [];
};
@@ -15,13 +18,16 @@ export interface TpkValidationInputPrefabSignature
}
export default class TpkValidationInputPrefabComponent extends Component {
- constructor(owner: unknown, args: TpkValidationInputPrefabSignature['Args']) {
+ constructor(owner: Owner, args: TpkValidationInputPrefabSignature['Args']) {
super(owner, args);
assert(
'If you want use integer args, use TpkValidationInputIntegerPrefab',
- typeof args.min === 'undefined' || typeof args.max === 'undefined' || typeof args.step === 'undefined',
+ typeof args.min === 'undefined' ||
+ typeof args.max === 'undefined' ||
+ typeof args.step === 'undefined',
);
}
+
-
-
-
+ as |V|
+ >
+
+
+
diff --git a/packages/ember-input-validation/src/components/prefabs/tpk-validation-integer.gts b/packages/ember-input-validation/src/components/prefabs/tpk-validation-integer.gts
index 87898511..1589c67f 100644
--- a/packages/ember-input-validation/src/components/prefabs/tpk-validation-integer.gts
+++ b/packages/ember-input-validation/src/components/prefabs/tpk-validation-integer.gts
@@ -1,23 +1,17 @@
import TpkValidationInputComponent, {
type TpkValidationInputComponentSignature,
} from '../tpk-validation-input.gts';
-import {
- type BaseValidationSignature,
-} from '../base.ts';
+import { type BaseValidationSignature } from '../base.ts';
import TpkValidationErrorsComponent from './tpk-validation-errors.gts';
import { on } from '@ember/modifier';
import { action } from '@ember/object';
import MandatoryLabelComponent from './mandatory-label.gts';
import Component from '@glimmer/component';
-export interface TpkValidationIntegerComponentSignature
- extends BaseValidationSignature {
+export interface TpkValidationIntegerComponentSignature extends BaseValidationSignature {
Args: Omit<
TpkValidationInputComponentSignature['Args'],
- | 'step'
- | 'unmaskValue'
- | 'maskOptions'
-
+ 'step' | 'unmaskValue' | 'maskOptions'
> & {
unsigned?: boolean;
};
@@ -28,17 +22,16 @@ export interface TpkValidationIntegerComponentSignature
}
export default class TpkValidationIntegerComponent extends Component {
+ get min() {
+ return this.args.unsigned ? 0 : this.args.min;
+ }
-get min() {
- return this.args.unsigned ? 0 : this.args.min;
-}
-
-@action
-preventNonNumericInput(event: KeyboardEvent) {
- if(event.key ==="." || event.key === ","){
- event.preventDefault();
+ @action
+ preventNonNumericInput(event: KeyboardEvent) {
+ if (event.key === '.' || event.key === ',') {
+ event.preventDefault();
+ }
}
-}
+ class='tpk-integer-container'
+ data-test-tpk-prefab-integer-container={{@validationField}}
+ data-has-error='{{V.hasError}}'
+ {{! @glint-ignore }}
+ anchorScrollUp={{@validationField}}
+ ...attributes
+ >
+ class='tpk-label'
+ @label={{@label}}
+ @mandatory={{V.mandatory}}
+ />
diff --git a/packages/ember-input-validation/src/components/prefabs/tpk-validation-mobile.gts b/packages/ember-input-validation/src/components/prefabs/tpk-validation-mobile.gts
index bc06f3cb..dbde35bf 100644
--- a/packages/ember-input-validation/src/components/prefabs/tpk-validation-mobile.gts
+++ b/packages/ember-input-validation/src/components/prefabs/tpk-validation-mobile.gts
@@ -9,9 +9,9 @@ import TpkSelectComponent from '@triptyk/ember-input/components/tpk-select';
import TpkInputComponent from '@triptyk/ember-input/components/tpk-input';
import TpkValidationErrorsComponent from './tpk-validation-errors.gts';
import MandatoryLabelComponent from './mandatory-label.gts';
+import type Owner from '@ember/owner';
-export interface TpkValidationMobilePrefabSignature
- extends BaseValidationSignature {
+export interface TpkValidationMobilePrefabSignature extends BaseValidationSignature {
Args: Omit<
TpkValidationInputComponentSignature['Args'],
| 'type'
@@ -21,7 +21,6 @@ export interface TpkValidationMobilePrefabSignature
| 'mask'
| 'unmaskValue'
| 'maskOptions'
- | 'mask'
| 'changeEvent'
| 'onChange'
>;
@@ -47,7 +46,7 @@ const masks = {
export default class TpkValidationMobilePrefabComponent extends BaseValidationComponent {
defaultPrefix = { flag: '/BE.svg', code: '+32' };
@tracked selectedPrefix = this.defaultPrefix;
- @tracked prefixes: Prefix[] = [
+ prefixes: Prefix[] = [
{ flag: '/NL.svg', code: '+31' },
{ flag: '/BE.svg', code: '+32' },
{ flag: '/FR.svg', code: '+33' },
@@ -55,10 +54,7 @@ export default class TpkValidationMobilePrefabComponent extends BaseValidationCo
{ flag: '/LU.svg', code: '+352' },
];
- constructor(
- owner: unknown,
- args: TpkValidationMobilePrefabSignature['Args'],
- ) {
+ constructor(owner: Owner, args: TpkValidationMobilePrefabSignature['Args']) {
super(owner, args);
this.selectedPrefix = this.getPrefix();
}
@@ -98,12 +94,13 @@ export default class TpkValidationMobilePrefabComponent extends BaseValidationCo
}
@action
- onChangeValueMobile(value: unknown) {
+ onChangeValueMobile(value: string | number | Date | null) {
if (!value) {
this.args.changeset.set(this.args.validationField, value);
} else {
this.args.changeset.set(
this.args.validationField,
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
`${this.selectedPrefix.code}${value}`,
);
}
@@ -119,7 +116,7 @@ export default class TpkValidationMobilePrefabComponent extends BaseValidationCo
}
getValueFromOption = (option: unknown, key: keyof Prefix) =>
- (option as Prefix)[key] as string;
+ (option as Prefix)[key];
diff --git a/packages/ember-input-validation/src/components/prefabs/tpk-validation-national-number.gts b/packages/ember-input-validation/src/components/prefabs/tpk-validation-national-number.gts
index 7cddec0f..bf207d7d 100644
--- a/packages/ember-input-validation/src/components/prefabs/tpk-validation-national-number.gts
+++ b/packages/ember-input-validation/src/components/prefabs/tpk-validation-national-number.gts
@@ -1,12 +1,16 @@
-import TpkValidationInputComponent, { type TpkValidationInputComponentSignature } from "../tpk-validation-input.gts";
-import { type BaseValidationSignature } from "../base.ts";
+import TpkValidationInputComponent, {
+ type TpkValidationInputComponentSignature,
+} from '../tpk-validation-input.gts';
+import { type BaseValidationSignature } from '../base.ts';
import TpkValidationErrorsComponent from './tpk-validation-errors.gts';
-import MandatoryLabelComponent from "./mandatory-label.gts";
-import Component from "@glimmer/component";
+import MandatoryLabelComponent from './mandatory-label.gts';
+import Component from '@glimmer/component';
-export interface TpkValidationNationalNumberPrefabSignature
- extends BaseValidationSignature {
- Args: Omit;
+export interface TpkValidationNationalNumberPrefabSignature extends BaseValidationSignature {
+ Args: Omit<
+ TpkValidationInputComponentSignature['Args'],
+ 'type' | 'min' | 'max' | 'step' | 'mask' | 'maskOptions' | 'unmaskValue'
+ >;
Blocks: {
default: [];
};
@@ -14,12 +18,12 @@ export interface TpkValidationNationalNumberPrefabSignature
}
export default class TpkValidationNationalNumberPrefabComponent extends Component {
- mask = "00.00.00-000.00";
+ mask = '00.00.00-000.00';
+ as |V|
+ >
-
-
-
+
+
+ />
diff --git a/packages/ember-input-validation/src/components/prefabs/tpk-validation-number.gts b/packages/ember-input-validation/src/components/prefabs/tpk-validation-number.gts
index 2e7c3b95..a2a788bf 100644
--- a/packages/ember-input-validation/src/components/prefabs/tpk-validation-number.gts
+++ b/packages/ember-input-validation/src/components/prefabs/tpk-validation-number.gts
@@ -1,19 +1,15 @@
import TpkValidationInputComponent, {
type TpkValidationInputComponentSignature,
} from '../tpk-validation-input.gts';
-import {
- type BaseValidationSignature
-} from '../base.ts';
+import { type BaseValidationSignature } from '../base.ts';
import TpkValidationErrorsComponent from './tpk-validation-errors.gts';
import MandatoryLabelComponent from './mandatory-label.gts';
import Component from '@glimmer/component';
-export interface TpkValidationNumberComponentSignature
- extends BaseValidationSignature {
+export interface TpkValidationNumberComponentSignature extends BaseValidationSignature {
Args: Omit<
TpkValidationInputComponentSignature['Args'],
- | 'unmaskValue'
- | 'maskOptions'
+ 'unmaskValue' | 'maskOptions'
> & {
unsigned?: boolean;
};
@@ -45,21 +41,21 @@ export default class TpkValidationNumberPrefabComponent extends Component
+ class='tpk-number-container'
+ data-test-tpk-prefab-number-container={{@validationField}}
+ data-has-error='{{V.hasError}}'
+ {{! @glint-ignore }}
+ anchorScrollUp={{@validationField}}
+ ...attributes
+ >
-
+
diff --git a/packages/ember-input-validation/src/components/prefabs/tpk-validation-password.gts b/packages/ember-input-validation/src/components/prefabs/tpk-validation-password.gts
index 330e8d73..ca7a238a 100644
--- a/packages/ember-input-validation/src/components/prefabs/tpk-validation-password.gts
+++ b/packages/ember-input-validation/src/components/prefabs/tpk-validation-password.gts
@@ -8,19 +8,13 @@ import { on } from '@ember/modifier';
import TpkValidationErrorsComponent from './tpk-validation-errors.gts';
import MandatoryLabelComponent from './mandatory-label.gts';
import Component from '@glimmer/component';
+import eyeShut from '../../assets/eye-shut.svg';
+import eyeOpen from '../../assets/eye.svg';
-export interface TpkValidationPasswordPrefabSignature
- extends BaseValidationSignature {
+export interface TpkValidationPasswordPrefabSignature extends BaseValidationSignature {
Args: Omit<
TpkValidationInputComponentSignature['Args'],
- | 'type'
- | 'min'
- | 'max'
- | 'step'
- | 'mask'
- | 'unmaskValue'
- | 'maskOptions'
- | 'mask'
+ 'type' | 'min' | 'max' | 'step' | 'mask' | 'unmaskValue' | 'maskOptions'
>;
Blocks: {
default: [];
@@ -56,8 +50,9 @@ export default class TpkValidationPasswordPrefabComponent extends Component
@@ -77,11 +72,7 @@ export default class TpkValidationPasswordPrefabComponent extends Component
diff --git a/packages/ember-input-validation/src/components/prefabs/tpk-validation-radio.gts b/packages/ember-input-validation/src/components/prefabs/tpk-validation-radio.gts
index f672402b..795aee7b 100644
--- a/packages/ember-input-validation/src/components/prefabs/tpk-validation-radio.gts
+++ b/packages/ember-input-validation/src/components/prefabs/tpk-validation-radio.gts
@@ -5,8 +5,7 @@ import TpkValidationRadioComponent, {
import type { TOC } from '@ember/component/template-only';
import TpkValidationErrorsComponent from './tpk-validation-errors.gts';
-export interface TpkValidationRadioPrefabComponentSignature
- extends BaseValidationSignature {
+export interface TpkValidationRadioPrefabComponentSignature extends BaseValidationSignature {
Args: BaseValidationSignature['Args'] &
TpkValidationRadioComponentSignature['Args'] & {
onChange?: (value: string) => void;
@@ -34,7 +33,8 @@ const TpkValidationRadioPrefabComponent: TOC
diff --git a/packages/ember-input-validation/src/components/prefabs/tpk-validation-select-create.gts b/packages/ember-input-validation/src/components/prefabs/tpk-validation-select-create.gts
index b42a55fa..0abaedf3 100644
--- a/packages/ember-input-validation/src/components/prefabs/tpk-validation-select-create.gts
+++ b/packages/ember-input-validation/src/components/prefabs/tpk-validation-select-create.gts
@@ -6,15 +6,21 @@ import TpkSelectCreateComponent, {
type TpkSelectCreateSignature,
} from '@triptyk/ember-input/components/tpk-select-create';
import TpkValidationErrorsComponent from './tpk-validation-errors.gts';
-import type { Select } from '@triptyk/ember-input/components/tpk-select';
import { action } from '@ember/object';
+import type Owner from '@ember/owner';
+import type { SelectType } from '@triptyk/ember-input/components/tpk-select';
+import type { Merge } from 'type-fest';
-export interface TpkValidationSelectCreatePrefabSignature
- extends BaseValidationSignature {
- Args: BaseValidationSignature['Args'] &
- TpkSelectCreateSignature['Args'] & {
+type Args = BaseValidationSignature['Args'] &
+ Merge<
+ TpkSelectCreateSignature['Args'],
+ {
onChange?: TpkSelectCreateSignature['Args']['onChange'];
- };
+ }
+ >;
+
+export interface TpkValidationSelectCreatePrefabSignature extends BaseValidationSignature {
+ Args: Args;
Blocks: {
default: [];
};
@@ -23,7 +29,7 @@ export interface TpkValidationSelectCreatePrefabSignature
export default class TpkValidationSelectCreatePrefabComponent extends BaseValidationComponent
{
constructor(
- owner: unknown,
+ owner: Owner,
args: TpkValidationSelectCreatePrefabSignature['Args'],
) {
super(owner, args);
@@ -33,7 +39,7 @@ export default class TpkValidationSelectCreatePrefabComponent extends BaseValida
return this.mandatory ? `${this.args.label} *` : this.args.label;
}
- @action onChange(selection: unknown, select: Select, event?: Event) {
+ @action onChange(selection: unknown, select: SelectType, event?: Event) {
if (this.args.onChange) {
return this.args.onChange(selection, select, event);
}
@@ -48,8 +54,9 @@ export default class TpkValidationSelectCreatePrefabComponent extends BaseValida
diff --git a/packages/ember-input-validation/src/components/prefabs/tpk-validation-select-search.gts b/packages/ember-input-validation/src/components/prefabs/tpk-validation-select-search.gts
index 23ef5195..74503c6d 100644
--- a/packages/ember-input-validation/src/components/prefabs/tpk-validation-select-search.gts
+++ b/packages/ember-input-validation/src/components/prefabs/tpk-validation-select-search.gts
@@ -6,14 +6,25 @@ import TpkSelectComponent from '@triptyk/ember-input/components/tpk-select';
import TpkValidationErrorsComponent from './tpk-validation-errors.gts';
import { assert } from '@ember/debug';
import { action } from '@ember/object';
-import type { TpkSelectSignature, Select } from '@triptyk/ember-input/components/tpk-select';
+import type {
+ TpkSelectSignature,
+ SelectType,
+} from '@triptyk/ember-input/components/tpk-select';
+import type Owner from '@ember/owner';
+import type { Merge } from 'type-fest';
-export interface TpkValidationSelectSearchPrefabSignature
- extends BaseValidationSignature {
- Args: BaseValidationSignature['Args'] & TpkSelectSignature['Args'] & {
- onChange?: (value: unknown, select: Select, event?: Event) => void;
- onSearch: (term: string) => unknown[];
- };
+type Args = BaseValidationSignature['Args'] &
+ // need Merge otherwise onChange stays required
+ Merge<
+ TpkSelectSignature['Args'],
+ {
+ onChange?: (value: unknown, select: SelectType, event?: Event) => void;
+ onSearch: TpkSelectSignature['Args']['search'];
+ }
+ >;
+
+export interface TpkValidationSelectSearchPrefabSignature extends BaseValidationSignature {
+ Args: Args;
Blocks: {
default: [];
};
@@ -22,7 +33,7 @@ export interface TpkValidationSelectSearchPrefabSignature
export default class TpkValidationSelectSearchPrefabComponent extends BaseValidationComponent {
constructor(
- owner: unknown,
+ owner: Owner,
args: TpkValidationSelectSearchPrefabSignature['Args'],
) {
super(owner, args);
@@ -36,7 +47,7 @@ export default class TpkValidationSelectSearchPrefabComponent extends BaseValida
return this.mandatory ? `${this.args.label} *` : this.args.label;
}
- @action onChange(selection: unknown, select: Select, event?: Event) {
+ @action onChange(selection: unknown, select: SelectType, event?: Event) {
if (this.args.onChange) {
return this.args.onChange(selection, select, event);
}
@@ -49,10 +60,11 @@ export default class TpkValidationSelectSearchPrefabComponent extends BaseValida
diff --git a/packages/ember-input-validation/src/components/prefabs/tpk-validation-select.gts b/packages/ember-input-validation/src/components/prefabs/tpk-validation-select.gts
index b22849d0..3afcd85a 100644
--- a/packages/ember-input-validation/src/components/prefabs/tpk-validation-select.gts
+++ b/packages/ember-input-validation/src/components/prefabs/tpk-validation-select.gts
@@ -1,15 +1,34 @@
-import { action } from "@ember/object";
-import { BaseValidationComponent, type BaseValidationSignature } from "../base.ts";
+import { action } from '@ember/object';
+import {
+ BaseValidationComponent,
+ type BaseValidationSignature,
+} from '../base.ts';
import TpkValidationErrorsComponent from './tpk-validation-errors.gts';
-import { assert } from "@ember/debug";
-import TpkSelectComponent, { type TpkSelectSignature, type Select } from "@triptyk/ember-input/components/tpk-select";
+import { assert } from '@ember/debug';
+import TpkSelectComponent, {
+ type TpkSelectSignature,
+ type SelectType,
+} from '@triptyk/ember-input/components/tpk-select';
+import type Owner from '@ember/owner';
+import type { Merge } from 'type-fest';
+
+type Args = BaseValidationSignature['Args'] &
+ // need Merge otherwise onChange stays required
+ Merge<
+ TpkSelectSignature['Args'],
+ {
+ onChange?: (value: unknown, select: SelectType, event?: Event) => void;
+ }
+ >;
export interface TpkValidationSelectPrefabSignature extends BaseValidationSignature {
Args: Omit<
- BaseValidationSignature['Args'] & TpkSelectSignature['Args'] & {
- onChange?: (value: unknown, select: Select, event?: Event) => void;
- },
- 'searchField' | 'searchPlaceholder' | 'searchMessage' | 'noMatchesMessage' | 'search'
+ Args,
+ | 'searchField'
+ | 'searchPlaceholder'
+ | 'searchMessage'
+ | 'noMatchesMessage'
+ | 'search'
>;
Blocks: {
default: [];
@@ -18,10 +37,7 @@ export interface TpkValidationSelectPrefabSignature extends BaseValidationSignat
}
export default class TpkValidationSelectPrefabComponent extends BaseValidationComponent {
- constructor(
- owner: unknown,
- args: TpkValidationSelectPrefabSignature['Args'],
- ) {
+ constructor(owner: Owner, args: TpkValidationSelectPrefabSignature['Args']) {
super(owner, args);
assert(
'If you want use search, please use TpkValidationSelectSearchPrefab',
@@ -30,7 +46,7 @@ export default class TpkValidationSelectPrefabComponent extends BaseValidationCo
}
@action
- onChange(selection: unknown, select: Select, event?: Event) {
+ onChange(selection: unknown, select: SelectType, event?: Event) {
if (this.args.onChange) {
return this.args.onChange(selection, select, event);
}
@@ -42,19 +58,25 @@ export default class TpkValidationSelectPrefabComponent extends BaseValidationCo
}
toString = (v: unknown) => {
+ assert(
+ 'TpkValidationSelectPrefab toString: object has no custom toString method, returning [object Object]',
+ // eslint-disable-next-line @typescript-eslint/no-base-to-string
+ !(v && typeof v === 'object' && v.toString() === '[object Object]'),
+ );
return String(v).toString();
};
+ as |S|
+ >
{{this.toString O.option}}
diff --git a/packages/ember-input-validation/src/components/prefabs/tpk-validation-textarea.gts b/packages/ember-input-validation/src/components/prefabs/tpk-validation-textarea.gts
index 49edefc5..430a141f 100644
--- a/packages/ember-input-validation/src/components/prefabs/tpk-validation-textarea.gts
+++ b/packages/ember-input-validation/src/components/prefabs/tpk-validation-textarea.gts
@@ -1,19 +1,26 @@
-import TpkValidationTextareaComponent, { type TpkValidationTextareaComponentSignature } from "../tpk-validation-textarea.gts";
-import { type BaseValidationSignature } from "../base.ts";
+import TpkValidationTextareaComponent, {
+ type TpkValidationTextareaComponentSignature,
+} from '../tpk-validation-textarea.gts';
+import { type BaseValidationSignature } from '../base.ts';
import TpkValidationErrorsComponent from './tpk-validation-errors.gts';
-import MandatoryLabelComponent from "./mandatory-label.gts";
+import MandatoryLabelComponent from './mandatory-label.gts';
import { type TOC } from '@ember/component/template-only';
+import type { Merge } from 'type-fest';
-export interface TpkValidationTextareaPrefabSignature
- extends BaseValidationSignature {
- Args: BaseValidationSignature['Args'] & TpkValidationTextareaComponentSignature['Args'] & { mandatory: boolean };
+export interface TpkValidationTextareaPrefabSignature extends BaseValidationSignature {
+ Args: BaseValidationSignature['Args'] &
+ Merge<
+ TpkValidationTextareaComponentSignature['Args'],
+ { mandatory?: boolean }
+ >;
Blocks: {
default: [];
};
Element: HTMLElement;
}
-const TpkValidationTextareaPrefabComponent: TOC =
+const TpkValidationTextareaPrefabComponent: TOC =
+
+ as |V|
+ >
-
+
{{#if @maxLength}}
-
- {{V.charCount}} / {{@maxLength}}
+
+ {{V.charCount}}
+ /
+ {{@maxLength}}
{{/if}}
diff --git a/packages/ember-input-validation/src/components/prefabs/tpk-validation-timepicker.gts b/packages/ember-input-validation/src/components/prefabs/tpk-validation-timepicker.gts
index 9c4932db..3bd9aef5 100644
--- a/packages/ember-input-validation/src/components/prefabs/tpk-validation-timepicker.gts
+++ b/packages/ember-input-validation/src/components/prefabs/tpk-validation-timepicker.gts
@@ -6,9 +6,9 @@ import { type BaseValidationSignature } from '../base.ts';
import { tracked } from '@glimmer/tracking';
import MandatoryLabelComponent from './mandatory-label.gts';
import Component from '@glimmer/component';
+import type Owner from '@ember/owner';
-export interface TpkValidationTimepickerPrefabSignature
- extends BaseValidationSignature {
+export interface TpkValidationTimepickerPrefabSignature extends BaseValidationSignature {
Args: Omit<
TpkValidationDatepickerComponentSignature['Args'] & {
onChange?: (value: Date[]) => void;
@@ -40,7 +40,7 @@ export default class TpkValidationTimepickerPrefabComponent extends Component
diff --git a/packages/ember-input-validation/src/components/prefabs/tpk-validation-vat.gts b/packages/ember-input-validation/src/components/prefabs/tpk-validation-vat.gts
index 7c962c7c..37dcab74 100644
--- a/packages/ember-input-validation/src/components/prefabs/tpk-validation-vat.gts
+++ b/packages/ember-input-validation/src/components/prefabs/tpk-validation-vat.gts
@@ -11,21 +11,13 @@ import MandatoryLabelComponent from './mandatory-label.gts';
import Component from '@glimmer/component';
import { action } from '@ember/object';
-export interface TpkValidationVATPrefabSignature
- extends BaseValidationSignature {
+export interface TpkValidationVATPrefabSignature extends BaseValidationSignature {
Args: Omit<
TpkValidationInputComponentSignature['Args'],
- | 'type'
- | 'min'
- | 'max'
- | 'step'
- | 'mask'
- | 'maskOptions'
- | 'unmaskValue'
- | 'mask'
+ 'type' | 'min' | 'max' | 'step' | 'mask' | 'maskOptions' | 'unmaskValue'
> & {
mandatory?: boolean;
- onChange?: (value: string, e: Event) => void;
+ onChange?: (value: string, e: Event) => void;
};
Blocks: {
default: [];
@@ -78,9 +70,9 @@ export default class TpkValidationVATPrefabComponent extends Component
diff --git a/packages/ember-input-validation/src/components/tpk-form.gts b/packages/ember-input-validation/src/components/tpk-form.gts
index 29b4bd17..ba6977d8 100644
--- a/packages/ember-input-validation/src/components/tpk-form.gts
+++ b/packages/ember-input-validation/src/components/tpk-form.gts
@@ -1,11 +1,12 @@
import type Owner from '@ember/owner';
import { service } from '@ember/service';
import Component from '@glimmer/component';
-import type { Promisable } from 'type-fest';
-import { assert } from '@ember/debug';
+import type { PartialDeep, Promisable } from 'type-fest';
+import { assert, debug } from '@ember/debug';
import { task } from 'ember-concurrency';
import { ImmerChangeset, isChangeset } from 'ember-immer-changeset';
-import { Schema } from 'yup';
+import type * as z from 'zod';
+import { ZodObject } from 'zod';
import { isFieldError } from '../utils/is-field-error.ts';
import perform from 'ember-concurrency/helpers/perform';
import {
@@ -49,11 +50,24 @@ import type TpkValidationRadioGroupComponent from './tpk-validation-radio-group.
import type TpkValidationRadioPrefabComponent from './prefabs/tpk-validation-radio.gts';
import type TpkValidationRadioGroupPrefabComponent from './prefabs/tpk-validation-radio-group.gts';
import type TpkValidationFilePrefabComponent from './prefabs/tpk-validation-file.gts';
+import { trackedArray } from '@ember/reactive/collections';
-interface ChangesetFormComponentArgs {
+type DeepNullable = {
+ [K in keyof T]: DeepNullable | null;
+};
+
+type DeepNothing = DeepNullable>;
+
+interface ChangesetFormComponentArgs<
+ S extends ZodObject,
+ T extends ImmerChangeset>>,
+> {
changeset: T;
- onSubmit: (changeset: T) => Promisable;
- validationSchema: Schema;
+ onSubmit: (
+ data: z.infer,
+ changeset: ImmerChangeset>,
+ ) => Promisable;
+ validationSchema: S;
reactive?: boolean;
removeErrorsOnSubmit?: boolean;
autoScrollOnError?: boolean;
@@ -61,8 +75,11 @@ interface ChangesetFormComponentArgs {
executeOnValid?: boolean;
}
-export interface ChangesetFormComponentSignature {
- Args: ChangesetFormComponentArgs;
+export interface ChangesetFormComponentSignature<
+ S extends ZodObject,
+ T extends ImmerChangeset>>,
+> {
+ Args: ChangesetFormComponentArgs;
Blocks: {
default: [
{
@@ -195,13 +212,15 @@ export interface ChangesetFormComponentSignature {
}
export default class ChangesetFormComponent<
- T extends ImmerChangeset,
-> extends Component> {
- @tracked declare requiredFields: string[];
+ S extends ZodObject,
+ T extends ImmerChangeset>>,
+> extends Component> {
+ @tracked requiredFields: string[] = trackedArray([]);
@service declare tpkForm: TpkFormService;
- public constructor(owner: Owner, args: ChangesetFormComponentArgs) {
+ public constructor(owner: Owner, args: ChangesetFormComponentArgs) {
super(owner, args);
+
assert(
'@changeset is required and must be an ImmerChangeset',
isChangeset(args.changeset) && args.changeset instanceof ImmerChangeset,
@@ -209,13 +228,16 @@ export default class ChangesetFormComponent<
assert('@onSubmit is required', typeof args.onSubmit === 'function');
assert(
'@validationSchema is required',
- args.validationSchema instanceof Schema,
+ args.validationSchema instanceof ZodObject,
);
+ assert('service:tpk-form is available', this.tpkForm !== undefined);
this.requiredFields =
getRequiredFields(this.args.validationSchema, this.args.changeset.data) ??
[];
- this.args.changeset.onSet(async () => {
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
+ this.args.changeset.onSet(async (k) => {
+ debug('Changeset key changed (for required fields): ' + k);
await this.args.changeset.validate((draft) => {
this.requiredFields =
getRequiredFields(this.args.validationSchema, draft) ?? [];
@@ -223,7 +245,9 @@ export default class ChangesetFormComponent<
});
if (args.reactive ?? true) {
- this.args.changeset.onSet(async (key) => {
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
+ this.args.changeset.onSet(async (key: string) => {
+ debug(`Changeset key changed: ${key}`);
await this.args.changeset.validate(async (draft) => {
const errors = await validateOneAndMapErrors(
key,
@@ -246,7 +270,14 @@ export default class ChangesetFormComponent<
}
validateAndSubmit = task(this, { drop: true }, async () => {
+ debug(
+ `Submitting form with changeset: ${JSON.stringify(this.args.changeset['draftData'], null, 2)}`,
+ );
+
if (this.args.removeErrorsOnSubmit ?? true) {
+ debug(
+ `Removed ${this.args.changeset.errors.length} errors before submit`,
+ );
this.args.changeset.removeErrors();
}
@@ -255,20 +286,28 @@ export default class ChangesetFormComponent<
this.args.validationSchema,
dto,
);
+ debug(`Errors after validation: ${JSON.stringify(errors, null, 2)}`);
for (const error of errors) {
this.args.changeset.addError(error);
}
});
if (!this.args.changeset.isValid) {
+ debug('Changeset is not valid, aborting submit');
return;
}
if (this.args.executeOnValid ?? true) {
+ debug('Changeset is valid, executing changeset');
this.args.changeset.execute();
}
- await this.args.onSubmit(this.args.changeset);
+ debug('Calling onSubmit callback');
+ await this.args.onSubmit(
+ this.args.changeset.data as z.infer,
+ // It is theorically safe. The only way it could be unsafe is if the user unexecutes the changeset after validation. If this is the case, the type will mismatch the runtime type. We will rarely do that so it's fine at the moment.
+ this.args.changeset as unknown as ImmerChangeset>,
+ );
});
submit = task(this, async (e: Event) => {
@@ -276,12 +315,12 @@ export default class ChangesetFormComponent<
await this.validateAndSubmit.perform();
});
- changesetGet = (path: string) => {
+ changesetGet = (path: string): unknown => {
return this.args.changeset.get(path);
};
get errorsForScroll() {
- return this.args.autoScrollOnError ?? true
+ return (this.args.autoScrollOnError ?? true)
? this.args.changeset.errors
: [];
}
diff --git a/packages/ember-input-validation/src/components/tpk-validation-checkbox.gts b/packages/ember-input-validation/src/components/tpk-validation-checkbox.gts
index 704eec35..5ab4e450 100644
--- a/packages/ember-input-validation/src/components/tpk-validation-checkbox.gts
+++ b/packages/ember-input-validation/src/components/tpk-validation-checkbox.gts
@@ -8,11 +8,11 @@ import TpkCheckbox from '@triptyk/ember-input/components/tpk-checkbox';
import type { TpkCheckboxSignature } from '@triptyk/ember-input/components/tpk-checkbox';
import { hash } from '@ember/helper';
-export interface TpkValidationCheckboxComponentSignature
- extends BaseValidationSignature {
- Args: BaseValidationSignature['Args'] & TpkCheckboxSignature['Args'] & {
- onChange?: (isChecked: boolean, value: string, e: Event) => void;
- };
+export interface TpkValidationCheckboxComponentSignature extends BaseValidationSignature {
+ Args: BaseValidationSignature['Args'] &
+ TpkCheckboxSignature['Args'] & {
+ onChange?: (isChecked: boolean, value: string, e: Event) => void;
+ };
Blocks: {
default: [
{
diff --git a/packages/ember-input-validation/src/components/tpk-validation-datepicker.gts b/packages/ember-input-validation/src/components/tpk-validation-datepicker.gts
index 334f7627..85683f80 100644
--- a/packages/ember-input-validation/src/components/tpk-validation-datepicker.gts
+++ b/packages/ember-input-validation/src/components/tpk-validation-datepicker.gts
@@ -10,8 +10,7 @@ import TpkDatepicker, {
type TpkDatepickerSignature,
} from '@triptyk/ember-input/components/tpk-datepicker';
-export interface TpkValidationDatepickerComponentSignature
- extends BaseValidationSignature {
+export interface TpkValidationDatepickerComponentSignature extends BaseValidationSignature {
Args: Omit<
BaseValidationSignature['Args'] & {
label: string;
@@ -33,7 +32,9 @@ export interface TpkValidationDatepickerComponentSignature
},
];
};
- Element: HTMLDivElement;
+ Element: HTMLDivElement & {
+ anchorScrollUp: string;
+ };
}
export default class TpkValidationDatepickerComponent extends BaseValidationComponent {
@@ -56,12 +57,16 @@ export default class TpkValidationDatepickerComponent extends BaseValidationComp
get value() {
assert(
- `@value must be a string, date or null for @${this.args.validationField}`,
+ `@value must be a string, Date, null or [Date, Date] for @${this.args.validationField}`,
typeof super.value === 'string' ||
super.value instanceof Date ||
+ (this.args.mode === 'range' &&
+ Array.isArray(super.value) &&
+ super.value.length === 2 &&
+ super.value.every((item) => item instanceof Date)) ||
super.value === null,
);
- return super.value;
+ return super.value as string | Date | [Date, Date] | null;
}
diff --git a/packages/ember-input-validation/src/components/tpk-validation-file.gts b/packages/ember-input-validation/src/components/tpk-validation-file.gts
index 7f0a0877..04bb6c98 100644
--- a/packages/ember-input-validation/src/components/tpk-validation-file.gts
+++ b/packages/ember-input-validation/src/components/tpk-validation-file.gts
@@ -9,8 +9,7 @@ import TpkFile, {
import { hash } from '@ember/helper';
-export interface TpkValidationFileComponentSignature
- extends BaseValidationSignature {
+export interface TpkValidationFileComponentSignature extends BaseValidationSignature {
Args: BaseValidationSignature['Args'] & {
label: string;
multiple?: boolean;
diff --git a/packages/ember-input-validation/src/components/tpk-validation-input.gts b/packages/ember-input-validation/src/components/tpk-validation-input.gts
index ea7735ca..44b4e8cf 100644
--- a/packages/ember-input-validation/src/components/tpk-validation-input.gts
+++ b/packages/ember-input-validation/src/components/tpk-validation-input.gts
@@ -8,8 +8,7 @@ import type { TpkInputSignature } from '@triptyk/ember-input/components/tpk-inpu
import TpkInput from '@triptyk/ember-input/components/tpk-input';
import { hash } from '@ember/helper';
-export interface TpkValidationInputComponentSignature
- extends BaseValidationSignature {
+export interface TpkValidationInputComponentSignature extends BaseValidationSignature {
Args: BaseValidationSignature['Args'] &
TpkInputSignature['Args'] & {
onChange?: (value: string | number | Date | null, e: Event) => void;
@@ -30,6 +29,7 @@ export interface TpkValidationInputComponentSignature
export default class TpkValidationInputComponent extends BaseValidationComponent {
@tracked showPassword = false;
+
@action onChange(value: string | number | Date | null, e: Event) {
if (this.args.onChange) {
return this.args.onChange(value, e);
diff --git a/packages/ember-input-validation/src/components/tpk-validation-radio-group.gts b/packages/ember-input-validation/src/components/tpk-validation-radio-group.gts
index 769d439c..3bef0922 100644
--- a/packages/ember-input-validation/src/components/tpk-validation-radio-group.gts
+++ b/packages/ember-input-validation/src/components/tpk-validation-radio-group.gts
@@ -8,8 +8,7 @@ import { hash } from '@ember/helper';
import type { WithBoundArgs } from '@glint/template';
import { assert } from '@ember/debug';
-export interface TpkValidationRadioGroupComponentSignature
- extends BaseValidationSignature {
+export interface TpkValidationRadioGroupComponentSignature extends BaseValidationSignature {
Args: BaseValidationSignature['Args'] & {
classless?: boolean;
unmaskValue?: boolean;
diff --git a/packages/ember-input-validation/src/components/tpk-validation-radio.gts b/packages/ember-input-validation/src/components/tpk-validation-radio.gts
index df251ee9..2baa50d6 100644
--- a/packages/ember-input-validation/src/components/tpk-validation-radio.gts
+++ b/packages/ember-input-validation/src/components/tpk-validation-radio.gts
@@ -8,8 +8,7 @@ import TpkRadio, {
} from '@triptyk/ember-input/components/tpk-radio';
import { hash } from '@ember/helper';
-export interface TpkValidationRadioComponentSignature
- extends BaseValidationSignature {
+export interface TpkValidationRadioComponentSignature extends BaseValidationSignature {
Args: BaseValidationSignature['Args'] & {
label: string;
classless?: boolean;
diff --git a/packages/ember-input-validation/src/components/tpk-validation-select.gts b/packages/ember-input-validation/src/components/tpk-validation-select.gts
index 8900edda..87877f40 100644
--- a/packages/ember-input-validation/src/components/tpk-validation-select.gts
+++ b/packages/ember-input-validation/src/components/tpk-validation-select.gts
@@ -5,14 +5,14 @@ import {
} from './base.ts';
import type { TpkSelectSignature } from '@triptyk/ember-input/components/tpk-select';
import TpkSelectComponent, {
- type Select,
+ type SelectType,
} from '@triptyk/ember-input/components/tpk-select';
import { hash } from '@ember/helper';
export interface TpkValidationSelectComponentSignature {
Args: BaseValidationSignature['Args'] &
TpkSelectSignature['Args'] & {
- onChange?: (value: unknown, select: Select, event?: Event) => void;
+ onChange?: (value: unknown, select: SelectType, event?: Event) => void;
};
Blocks: {
default: [
@@ -29,7 +29,7 @@ export interface TpkValidationSelectComponentSignature {
}
export default class TpkValidationSelect extends BaseValidationComponent {
- @action onChange(selection: unknown, select: Select, event?: Event) {
+ @action onChange(selection: unknown, select: SelectType, event?: Event) {
if (this.args.onChange) {
return this.args.onChange(selection, select, event);
}
@@ -44,6 +44,7 @@ export default class TpkValidationSelect extends BaseValidationComponent
diff --git a/packages/ember-input-validation/src/components/tpk-validation-textarea.gts b/packages/ember-input-validation/src/components/tpk-validation-textarea.gts
index e555ffac..0cfed07a 100644
--- a/packages/ember-input-validation/src/components/tpk-validation-textarea.gts
+++ b/packages/ember-input-validation/src/components/tpk-validation-textarea.gts
@@ -3,14 +3,16 @@ import {
BaseValidationComponent,
type BaseValidationSignature,
} from './base.ts';
-import TpkTextarea, { type TpkTextareaSignature } from '@triptyk/ember-input/components/tpk-textarea';
+import TpkTextarea, {
+ type TpkTextareaSignature,
+} from '@triptyk/ember-input/components/tpk-textarea';
import { hash } from '@ember/helper';
-export interface TpkValidationTextareaComponentSignature
- extends BaseValidationSignature {
- Args: BaseValidationSignature['Args'] & TpkTextareaSignature['Args'] & {
- onChange?: (value: string, e: Event) => void;
- };
+export interface TpkValidationTextareaComponentSignature extends BaseValidationSignature {
+ Args: BaseValidationSignature['Args'] &
+ TpkTextareaSignature['Args'] & {
+ onChange?: (value: string, e: Event) => void;
+ };
Blocks: {
default: [
{
diff --git a/packages/ember-input-validation/src/index.ts b/packages/ember-input-validation/src/index.ts
index fbf4e3e3..89d5848f 100644
--- a/packages/ember-input-validation/src/index.ts
+++ b/packages/ember-input-validation/src/index.ts
@@ -1 +1,8 @@
-export * from './components/prefabs/tpk-validation-password.gts';
+import { buildRegistry } from 'ember-strict-application-resolver/build-registry';
+import * as TpkFormServiceModule from './services/tpk-form.ts';
+
+export function moduleRegistry() {
+ return buildRegistry({
+ './services/tpk-form': TpkFormServiceModule,
+ })();
+}
diff --git a/packages/ember-input-validation/src/modifiers/scroll-on-error.ts b/packages/ember-input-validation/src/modifiers/scroll-on-error.ts
index f77cb77e..caf2d1b3 100644
--- a/packages/ember-input-validation/src/modifiers/scroll-on-error.ts
+++ b/packages/ember-input-validation/src/modifiers/scroll-on-error.ts
@@ -1,4 +1,4 @@
-import { modifier } from 'ember-modifier';
+import { modifier, type FunctionBasedModifier } from 'ember-modifier';
import type { ValidationError } from 'ember-immer-changeset';
import { runTask } from 'ember-lifeline';
@@ -22,16 +22,25 @@ export function scrollToFirstError(
const targetTop =
errorElement.getBoundingClientRect().top + window.scrollY - 85;
- runTask(target, () => {
- window.scrollTo({ top: targetTop, behavior: 'smooth' });
- }, 20);
+ runTask(
+ target,
+ () => {
+ window.scrollTo({ top: targetTop, behavior: 'smooth' });
+ },
+ 20,
+ );
}
}
-export default modifier(function scrollOnError(
+const scrollOnErrorModifier: FunctionBasedModifier<{
+ Args: { Positional: [ValidationError[]]; Named: object };
+ Element: Element;
+}> = modifier(function scrollOnError(
this: object,
element,
[errors]: [ValidationError[]],
) {
scrollToFirstError(this, element, errors);
});
+
+export default scrollOnErrorModifier;
diff --git a/packages/ember-input-validation/src/template-registry.ts b/packages/ember-input-validation/src/template-registry.ts
index 5e5b970b..51feca0d 100644
--- a/packages/ember-input-validation/src/template-registry.ts
+++ b/packages/ember-input-validation/src/template-registry.ts
@@ -6,6 +6,7 @@ import TpkValidationInputComponent from './components/tpk-validation-input.gts';
import TpkValidationRadioComponent from './components/tpk-validation-radio.gts';
import TpkValidationSelectComponent from './components/tpk-validation-select.gts';
import TpkValidationTextareaComponent from './components/tpk-validation-textarea.gts';
+import type ChangesetFormComponent from './components/tpk-form.gts';
export default interface Registry {
'tpk-validation-checkbox': typeof TpkValidationCheckboxComponent;
@@ -24,4 +25,5 @@ export default interface Registry {
TpkValidationSelect: typeof TpkValidationSelectComponent;
'tpk-validation-textarea': typeof TpkValidationTextareaComponent;
TpkValidationTextarea: typeof TpkValidationTextareaComponent;
+ 'tpk-form': typeof ChangesetFormComponent;
}
diff --git a/packages/ember-input-validation/src/utils/clear-object.ts b/packages/ember-input-validation/src/utils/clear-object.ts
index 1fe6279d..25b9b584 100644
--- a/packages/ember-input-validation/src/utils/clear-object.ts
+++ b/packages/ember-input-validation/src/utils/clear-object.ts
@@ -1,24 +1,34 @@
-export function clearObjectValues(obj: Record): Record {
- const newObj: Record = {};
+export function clearObjectValues(
+ obj: Record,
+): Record {
+ const newObj: Record = {};
for (const key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
if (typeof obj[key] === 'object' && obj[key] !== null) {
if (Array.isArray(obj[key])) {
- newObj[key] = obj[key].map((item: any) => {
- if (typeof item === 'object' && item !== null) {
- return clearObjectValues(item);
- } else {
- return null;
- }
- }).filter(item => item !== null);
+ newObj[key] = obj[key]
+ .map((item) => {
+ if (typeof item === 'object' && item !== null) {
+ return clearObjectValues(item as Record);
+ } else {
+ return null;
+ }
+ })
+ .filter((item) => item !== null);
} else {
- newObj[key] = clearObjectValues(obj[key]);
+ newObj[key] = clearObjectValues(obj[key] as Record);
}
} else if (typeof obj[key] === 'boolean') {
newObj[key] = false;
- } else {
+ } else if (typeof obj[key] === 'number') {
+ newObj[key] = 0;
+ } else if (typeof obj[key] === 'string') {
newObj[key] = '';
+ } else if (typeof obj[key] === 'undefined') {
+ newObj[key] = undefined;
+ } else {
+ newObj[key] = null;
}
}
}
diff --git a/packages/ember-input-validation/src/utils/get-required-fields.ts b/packages/ember-input-validation/src/utils/get-required-fields.ts
index e5bf0b84..c27a3883 100644
--- a/packages/ember-input-validation/src/utils/get-required-fields.ts
+++ b/packages/ember-input-validation/src/utils/get-required-fields.ts
@@ -1,24 +1,28 @@
-import { ValidationError, type Schema } from "yup";
-import { clearObjectValues } from "./clear-object.ts";
-import { jsonPathToDottedPath } from "./validate-and-map.ts";
+import { ZodError, ZodObject } from 'zod';
+import { clearObjectValues } from './clear-object.ts';
+import { jsonPathToDottedPath } from './validate-and-map.ts';
-export function getRequiredFields(validationSchema: Schema, data: Record): string[] | undefined {
+export function getRequiredFields(
+ validationSchema: ZodObject,
+ data: Record,
+): string[] | undefined {
const clearedObject = clearObjectValues(data);
try {
- validationSchema.validateSync(clearedObject, { abortEarly: false });
- } catch(e) {
- if (e instanceof ValidationError) {
- const errorFields = e.inner.map((err) => ({
- type: err.type,
- path: err.path,
+ validationSchema.parse(clearedObject);
+ } catch (e) {
+ if (e instanceof ZodError) {
+ const errorFields = e.issues.map((err) => ({
+ type: err.code,
+ path: err.path.join('.'),
message: err.message,
- value: err.value,
+ value: err.input,
}));
- return errorFields
- .filter((e) => e.type === 'required')
- .map((error) => jsonPathToDottedPath(error.path ?? ''))
- .filter(r => r !== undefined);
+
+ const a = errorFields
+ .map((error) => jsonPathToDottedPath(error.path))
+ .filter((r) => r !== undefined);
+ return a;
}
}
}
diff --git a/packages/ember-input-validation/src/utils/mask-utils.ts b/packages/ember-input-validation/src/utils/mask-utils.ts
index 926bac9d..9083eda2 100644
--- a/packages/ember-input-validation/src/utils/mask-utils.ts
+++ b/packages/ember-input-validation/src/utils/mask-utils.ts
@@ -1,32 +1,37 @@
interface CompiledMasks {
- mask: string,
- definition?: Record,
- startsWith: string,
- default: boolean,
- lazy?: boolean,
+ mask: string;
+ definition?: Record;
+ startsWith: string;
+ default: boolean;
+ lazy?: boolean;
}
// feel free to complete this, this is not exhaustive
export interface DynamicMasked {
- rawInputValue: string,
- compiledMasks: CompiledMasks[],
+ rawInputValue: string;
+ compiledMasks: CompiledMasks[];
}
export const maskSpecialCharDefinition = {
'#': /[a-zA-Z]/,
'&': /[0-9]/,
- '$': /[a-zA-Z0-9]/,
-}
+ $: /[a-zA-Z0-9]/,
+};
-export function getMaskForPrefixOrDefault(_appended: string, dynamicMasked: DynamicMasked) {
- const mask = dynamicMasked.compiledMasks.find(mask => {
- return dynamicMasked.rawInputValue.slice(0, 2).toUpperCase() === mask.startsWith;
- })
+export function getMaskForPrefixOrDefault(
+ _appended: string,
+ dynamicMasked: DynamicMasked,
+) {
+ const mask = dynamicMasked.compiledMasks.find((mask) => {
+ return (
+ dynamicMasked.rawInputValue.slice(0, 2).toUpperCase() === mask.startsWith
+ );
+ });
if (!mask) {
- return dynamicMasked.compiledMasks.find(mask => {
+ return dynamicMasked.compiledMasks.find((mask) => {
return mask.default === true;
- })
+ });
}
return mask;
}
diff --git a/packages/ember-input-validation/src/utils/validate-and-map.ts b/packages/ember-input-validation/src/utils/validate-and-map.ts
index 2fd2a906..71cdb629 100644
--- a/packages/ember-input-validation/src/utils/validate-and-map.ts
+++ b/packages/ember-input-validation/src/utils/validate-and-map.ts
@@ -1,44 +1,83 @@
-import type { Schema } from 'yup';
-import { ValidationError } from 'yup';
+import { ZodError, ZodObject, type ZodType } from 'zod';
import { type ValidationError as ChangesetValidationError } from 'ember-immer-changeset';
+import { get } from '@ember/object';
+import { assert } from '@ember/debug';
-export async function validateAndMapErrors(
+export function deepPickByPath<
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ T extends ZodObject,
+>(schema: T, path: string): ZodType {
+ const keys = path.split('.');
+
+ function pick(
+ current: ZodType,
+ remaining: string[],
+ ): ZodType {
+ if (remaining.length === 0) {
+ return current;
+ }
+
+ if (!(current instanceof ZodObject)) {
+ throw new Error(`"${remaining[0]}" is not an object`);
+ }
+
+ const [key, ...rest] = remaining;
+ const shape = current.shape;
+
+ assert('key is defined', key);
+
+ if (!(key in shape)) {
+ throw new Error(`Key "${key}" not found in schema`);
+ }
+
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
+ return pick(shape[key], rest);
+ }
+
+ return pick(schema, keys);
+}
+
+export async function validateAndMapErrors(
schema: T,
dto: unknown,
): Promise {
try {
- await schema.validate(dto, { abortEarly: false });
+ await schema.parseAsync(dto);
return [];
} catch (e) {
- return applyErrors(e);
+ return applyErrors('', e);
}
}
-export async function validateOneAndMapErrors(
+export async function validateOneAndMapErrors(
path: string,
schema: T,
dto: unknown,
): Promise {
try {
- await schema.validateAt(dottedPathToJsonPath(path), dto, {
- abortEarly: false,
- recursive: false,
- });
+ const propSchema = deepPickByPath(schema, path);
+ await propSchema.parseAsync(get(dto, path));
return [];
} catch (e) {
- return applyErrors(e);
+ if (!(e instanceof ZodError))
+ console.warn('Non-ValidationError caught in validateOneAndMapErrors', e);
+
+ return applyErrors(path, e);
}
}
-function applyErrors(e: unknown) {
- if (e instanceof ValidationError) {
- const errs = e.inner.reduce((mergedErrors, e) => {
- const path = jsonPathToDottedPath(e.path ?? '');
+function applyErrors(prefix: string = '', e: unknown) {
+ if (e instanceof ZodError) {
+ const errs = e.issues.reduce((mergedErrors, e) => {
+ const errorPath = e.path.join('.');
+ const pathWithPrefix =
+ prefix && errorPath ? `${prefix}.${errorPath}` : prefix || errorPath;
+ const path = jsonPathToDottedPath(pathWithPrefix);
mergedErrors.push({
message: e.message,
- params: e.params,
+ params: e.code ? { code: e.code } : undefined,
key: path,
- value: e.value,
+ value: e.input,
originalValue: '',
});
return mergedErrors;
diff --git a/packages/ember-input-validation/tsconfig.json b/packages/ember-input-validation/tsconfig.json
index 4da7aa51..4162dc6f 100644
--- a/packages/ember-input-validation/tsconfig.json
+++ b/packages/ember-input-validation/tsconfig.json
@@ -1,17 +1,23 @@
+/**
+ * This tsconfig is not used for publishing.
+ * It's only for the local editing experience
+ * (and linting)
+ */
{
- "extends": "@tsconfig/ember/tsconfig.json",
+ "extends": "@ember/app-tsconfig",
"include": [
"src/**/*",
- "unpublished-development-types/**/*"
+ "tests/**/*",
+ "unpublished-development-types/**/*",
+ "demo-app/**/*"
],
- "glint": {
- "environment": ["ember-loose", "ember-template-imports"]
- },
"compilerOptions": {
- "skipLibCheck": true,
- "allowJs": true,
- "declarationDir": "declarations",
- "verbatimModuleSyntax": true,
- "allowImportingTsExtensions": true
+ "rootDir": ".",
+ "types": [
+ "ember-source/types",
+ "vite/client",
+ "@embroider/core/virtual",
+ "@glint/ember-tsc/types"
+ ]
}
}
diff --git a/packages/ember-input-validation/tsconfig.publish.json b/packages/ember-input-validation/tsconfig.publish.json
new file mode 100644
index 00000000..f3342537
--- /dev/null
+++ b/packages/ember-input-validation/tsconfig.publish.json
@@ -0,0 +1,27 @@
+/**
+ * This tsconfig is only used for publishing.
+ *
+ * For local dev experience, see the tsconfig.json
+ */
+{
+ "extends": "@ember/library-tsconfig",
+ "include": ["./src/**/*", "./unpublished-development-types/**/*"],
+ "compilerOptions": {
+ "allowJs": true,
+ "declarationDir": "declarations",
+
+ /**
+ https://www.typescriptlang.org/tsconfig#rootDir
+ "Default: The longest common path of all non-declaration input files."
+
+ Because we want our declarations' structure to match our rollup output,
+ we need this "rootDir" to match the "srcDir" in the rollup.config.mjs.
+
+ This way, we can have simpler `package.json#exports` that matches
+ imports to files on disk
+ */
+ "rootDir": "./src",
+
+ "types": ["ember-source/types", "@glint/ember-tsc/types", "vite/client"]
+ }
+}
diff --git a/packages/ember-input-validation/unpublished-development-types/index.d.ts b/packages/ember-input-validation/unpublished-development-types/index.d.ts
index 08ab6c22..d92a1320 100644
--- a/packages/ember-input-validation/unpublished-development-types/index.d.ts
+++ b/packages/ember-input-validation/unpublished-development-types/index.d.ts
@@ -1,12 +1,4 @@
// Add any types here that you need for local development only.
// These will *not* be published as part of your addon, so be careful that your published code does not rely on them!
import 'ember-source/types';
-import '@glint/environment-ember-loose';
-import '@glint/environment-ember-template-loose';
-
-declare module '@glint/environment-ember-loose/registry' {
- export default interface Registry {
- // Add any registry entries from other addons here that your addon itself uses (in non-strict mode templates)
- // See https://typed-ember.gitbook.io/glint/using-glint/ember/using-addons
- }
-}
+import '@glint/ember-tsc/types';
diff --git a/packages/ember-input/.eslintignore b/packages/ember-input/.eslintignore
deleted file mode 100644
index 4e982747..00000000
--- a/packages/ember-input/.eslintignore
+++ /dev/null
@@ -1,9 +0,0 @@
-# unconventional js
-/blueprints/*/files/
-
-# compiled output
-/dist/
-/declarations/
-
-# misc
-/coverage/
diff --git a/packages/ember-input/.eslintrc.cjs b/packages/ember-input/.eslintrc.cjs
deleted file mode 100644
index f3b9ec36..00000000
--- a/packages/ember-input/.eslintrc.cjs
+++ /dev/null
@@ -1,49 +0,0 @@
-module.exports = {
- overrides: [
- {
- files: ['**/*.{js,ts}'],
- plugins: ['ember'],
- parser: '@typescript-eslint/parser',
- extends: [
- 'eslint:recommended',
- 'plugin:ember/recommended', // or other configuration
- ],
- rules: {
- // override / enable optional rules
- 'ember/no-replace-test-comments': 'error'
- }
- },
- {
- files: ['**/*.gts'],
- parser: 'ember-eslint-parser',
- plugins: ['ember'],
- extends: [
- 'eslint:recommended',
- 'plugin:@typescript-eslint/recommended',
- 'plugin:ember/recommended',
- 'plugin:ember/recommended-gts',
- ],
- rules: {
- // override / enable optional rules
- 'ember/no-at-ember-render-modifiers': 'warn'
- }
- },
- {
- files: ['**/*.gjs'],
- parser: 'ember-eslint-parser',
- plugins: ['ember'],
- extends: [
- 'eslint:recommended',
- 'plugin:ember/recommended',
- 'plugin:ember/recommended-gjs',
- ],
- },
- {
- files: ['tests/**/*.{js,ts,gjs,gts}'],
- rules: {
- // override / enable optional rules
- 'ember/no-replace-test-comments': 'error'
- }
- },
- ],
-};
diff --git a/packages/ember-input/.template-lintrc.cjs b/packages/ember-input/.template-lintrc.cjs
deleted file mode 100644
index f35f61c7..00000000
--- a/packages/ember-input/.template-lintrc.cjs
+++ /dev/null
@@ -1,5 +0,0 @@
-'use strict';
-
-module.exports = {
- extends: 'recommended',
-};
diff --git a/packages/ember-input/.template-lintrc.mjs b/packages/ember-input/.template-lintrc.mjs
new file mode 100644
index 00000000..589ce8f7
--- /dev/null
+++ b/packages/ember-input/.template-lintrc.mjs
@@ -0,0 +1,3 @@
+export default {
+ extends: 'recommended',
+};
diff --git a/packages/ember-input/CHANGELOG.md b/packages/ember-input/CHANGELOG.md
index 38d9eab6..972a2e33 100644
--- a/packages/ember-input/CHANGELOG.md
+++ b/packages/ember-input/CHANGELOG.md
@@ -7,122 +7,70 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
**Note:** Version bump only for package @triptyk/ember-input
-
-
-
-
# [3.0.0](https://github.com/TRIPTYK/ember-common-ui/compare/v3.0.0-alpha.13...v3.0.0) (2025-04-18)
**Note:** Version bump only for package @triptyk/ember-input
-
-
-
-
# [3.0.0-alpha.13](https://github.com/TRIPTYK/ember-common-ui/compare/v3.0.0-alpha.12...v3.0.0-alpha.13) (2025-02-03)
**Note:** Version bump only for package @triptyk/ember-input
-
-
-
-
# [3.0.0-alpha.12](https://github.com/TRIPTYK/ember-common-ui/compare/v3.0.0-alpha.11...v3.0.0-alpha.12) (2025-01-27)
**Note:** Version bump only for package @triptyk/ember-input
-
-
-
-
# [3.0.0-alpha.11](https://github.com/TRIPTYK/ember-common-ui/compare/v3.0.0-alpha.10...v3.0.0-alpha.11) (2025-01-24)
-
### Features
-* add tpk-search input ([0c56a9d](https://github.com/TRIPTYK/ember-common-ui/commit/0c56a9d80273a8cd0b2b8dc5a4802ac39302527d))
-* button prefab ([b5391df](https://github.com/TRIPTYK/ember-common-ui/commit/b5391df3a08f4eea3c9972d991d81a2598b69cfc))
-* toggle switch ([6206fd4](https://github.com/TRIPTYK/ember-common-ui/commit/6206fd4035caa13ea83ffb864f37a983c9b6fe38))
-
-
-
-
+- add tpk-search input ([0c56a9d](https://github.com/TRIPTYK/ember-common-ui/commit/0c56a9d80273a8cd0b2b8dc5a4802ac39302527d))
+- button prefab ([b5391df](https://github.com/TRIPTYK/ember-common-ui/commit/b5391df3a08f4eea3c9972d991d81a2598b69cfc))
+- toggle switch ([6206fd4](https://github.com/TRIPTYK/ember-common-ui/commit/6206fd4035caa13ea83ffb864f37a983c9b6fe38))
# [3.0.0-alpha.10](https://github.com/TRIPTYK/ember-common-ui/compare/v3.0.0-alpha.9...v3.0.0-alpha.10) (2024-12-06)
-
### Bug Fixes
-* allow optional onChange ([fd94016](https://github.com/TRIPTYK/ember-common-ui/commit/fd940166d8203e32c1f2d86817d15e570d5f5d47))
-
-
-
-
+- allow optional onChange ([fd94016](https://github.com/TRIPTYK/ember-common-ui/commit/fd940166d8203e32c1f2d86817d15e570d5f5d47))
# [3.0.0-alpha.9](https://github.com/TRIPTYK/ember-common-ui/compare/v3.0.0-alpha.8...v3.0.0-alpha.9) (2024-12-06)
**Note:** Version bump only for package @triptyk/ember-input
-
-
-
-
# [3.0.0-alpha.8](https://github.com/TRIPTYK/ember-common-ui/compare/v3.0.0-alpha.7...v3.0.0-alpha.8) (2024-12-06)
**Note:** Version bump only for package @triptyk/ember-input
-
-
-
-
# [3.0.0-alpha.7](https://github.com/TRIPTYK/ember-common-ui/compare/v3.0.0-alpha.6...v3.0.0-alpha.7) (2024-12-05)
**Note:** Version bump only for package @triptyk/ember-input
-
-
-
-
# [3.0.0-alpha.6](https://github.com/TRIPTYK/ember-common-ui/compare/v3.0.0-alpha.5...v3.0.0-alpha.6) (2024-12-05)
**Note:** Version bump only for package @triptyk/ember-input
-
-
-
-
# [3.0.0-alpha.5](https://github.com/TRIPTYK/ember-common-ui/compare/v3.0.0-alpha.3...v3.0.0-alpha.5) (2024-12-03)
**Note:** Version bump only for package @triptyk/ember-input
-
-
-
-
# [3.0.0-alpha.4](https://github.com/TRIPTYK/ember-common-ui/compare/v3.0.0-alpha.3...v3.0.0-alpha.4) (2024-12-03)
**Note:** Version bump only for package @triptyk/ember-input
-
-
-
-
# [3.0.0-alpha.3](https://github.com/TRIPTYK/ember-common-ui/compare/v3.0.0-alpha.2...v3.0.0-alpha.3) (2024-12-03)
-
### Bug Fixes
-* convert null value to undefined ([b5661d2](https://github.com/TRIPTYK/ember-common-ui/commit/b5661d24b7d76ad2563cbeada1c87af26da3e86c))
-* make good for a11y and let just one theme to build faster daisy ([9de5e05](https://github.com/TRIPTYK/ember-common-ui/commit/9de5e05b1adcef966658d53527e77b9b85b34854))
-* mobile number is not reset when change other input in form ([23566a4](https://github.com/TRIPTYK/ember-common-ui/commit/23566a496b8a68961947d33cebd8eaf115d4c6d3))
-* type and merge ([12d7c7c](https://github.com/TRIPTYK/ember-common-ui/commit/12d7c7c9950976db0e15f080a0b035ac63eba87b))
-* use displayValue of mask instead of value ([4a3953a](https://github.com/TRIPTYK/ember-common-ui/commit/4a3953a28e6398a88db24b8617bc37d7f57a6aca))
-
+- convert null value to undefined ([b5661d2](https://github.com/TRIPTYK/ember-common-ui/commit/b5661d24b7d76ad2563cbeada1c87af26da3e86c))
+- make good for a11y and let just one theme to build faster daisy ([9de5e05](https://github.com/TRIPTYK/ember-common-ui/commit/9de5e05b1adcef966658d53527e77b9b85b34854))
+- mobile number is not reset when change other input in form ([23566a4](https://github.com/TRIPTYK/ember-common-ui/commit/23566a496b8a68961947d33cebd8eaf115d4c6d3))
+- type and merge ([12d7c7c](https://github.com/TRIPTYK/ember-common-ui/commit/12d7c7c9950976db0e15f080a0b035ac63eba87b))
+- use displayValue of mask instead of value ([4a3953a](https://github.com/TRIPTYK/ember-common-ui/commit/4a3953a28e6398a88db24b8617bc37d7f57a6aca))
### Features
-* add daisyui ([fce98a6](https://github.com/TRIPTYK/ember-common-ui/commit/fce98a6d2d3aee0f864088193a3f21dcdafa0d88))
-* add default design with daisy for select create prefab ([68bd7a4](https://github.com/TRIPTYK/ember-common-ui/commit/68bd7a4a5dc61edc34a7fba7ca6f534a6ddd44c6))
-* add default design with daisy for select prefab ([dc5d513](https://github.com/TRIPTYK/ember-common-ui/commit/dc5d513e3603deecaf549986b1bdb1af54b159c5))
-* remove classless feature ([dfed3d7](https://github.com/TRIPTYK/ember-common-ui/commit/dfed3d7226288bc84824f72f8f69174380604d97))
-* textarea prefab daisyui ([6bb6a22](https://github.com/TRIPTYK/ember-common-ui/commit/6bb6a222873142584439dcd5aa6e5cebfd2c86e5))
+- add daisyui ([fce98a6](https://github.com/TRIPTYK/ember-common-ui/commit/fce98a6d2d3aee0f864088193a3f21dcdafa0d88))
+- add default design with daisy for select create prefab ([68bd7a4](https://github.com/TRIPTYK/ember-common-ui/commit/68bd7a4a5dc61edc34a7fba7ca6f534a6ddd44c6))
+- add default design with daisy for select prefab ([dc5d513](https://github.com/TRIPTYK/ember-common-ui/commit/dc5d513e3603deecaf549986b1bdb1af54b159c5))
+- remove classless feature ([dfed3d7](https://github.com/TRIPTYK/ember-common-ui/commit/dfed3d7226288bc84824f72f8f69174380604d97))
+- textarea prefab daisyui ([6bb6a22](https://github.com/TRIPTYK/ember-common-ui/commit/6bb6a222873142584439dcd5aa6e5cebfd2c86e5))
diff --git a/packages/ember-input/babel.config.cjs b/packages/ember-input/babel.config.cjs
new file mode 100644
index 00000000..7b4df257
--- /dev/null
+++ b/packages/ember-input/babel.config.cjs
@@ -0,0 +1,51 @@
+/**
+ * This babel.config is not used for publishing.
+ * It's only for the local editing experience
+ * (and linting)
+ */
+const { buildMacros } = require('@embroider/macros/babel');
+
+const {
+ babelCompatSupport,
+ templateCompatSupport,
+} = require('@embroider/compat/babel');
+
+const macros = buildMacros();
+
+// For scenario testing
+const isCompat = Boolean(process.env.ENABLE_COMPAT_BUILD);
+
+module.exports = {
+ plugins: [
+ ['ember-concurrency/async-arrow-task-transform', {}],
+ [
+ '@babel/plugin-transform-typescript',
+ {
+ allExtensions: true,
+ allowDeclareFields: true,
+ onlyRemoveTypeImports: true,
+ },
+ ],
+ [
+ 'babel-plugin-ember-template-compilation',
+ {
+ transforms: [
+ ...(isCompat ? templateCompatSupport() : macros.templateMacros),
+ ],
+ },
+ ],
+ [
+ 'module:decorator-transforms',
+ {
+ runtime: {
+ import: require.resolve('decorator-transforms/runtime-esm'),
+ },
+ },
+ ],
+ ...(isCompat ? babelCompatSupport() : macros.babelMacros),
+ ],
+
+ generatorOpts: {
+ compact: false,
+ },
+};
diff --git a/packages/ember-input/babel.config.json b/packages/ember-input/babel.config.json
deleted file mode 100644
index 6d0c9ac0..00000000
--- a/packages/ember-input/babel.config.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "plugins": [
- ["@babel/plugin-transform-typescript", { "allExtensions": true, "onlyRemoveTypeImports": true, "allowDeclareFields": true }],
- "@embroider/addon-dev/template-colocation-plugin",
- "@babel/plugin-transform-class-static-block",
- ["babel-plugin-ember-template-compilation", {
- "targetFormat": "hbs",
- "transforms": []
- }],
- "ember-concurrency/async-arrow-task-transform",
- ["@babel/plugin-proposal-decorators", { "version": "legacy" }],
- "@babel/plugin-proposal-class-properties"
- ]
-}
diff --git a/packages/ember-input/babel.publish.config.cjs b/packages/ember-input/babel.publish.config.cjs
new file mode 100644
index 00000000..85ffa1d6
--- /dev/null
+++ b/packages/ember-input/babel.publish.config.cjs
@@ -0,0 +1,36 @@
+/**
+ * This babel.config is only used for publishing.
+ *
+ * For local dev experience, see the babel.config
+ */
+module.exports = {
+ plugins: [
+ [
+ '@babel/plugin-transform-typescript',
+ {
+ allExtensions: true,
+ allowDeclareFields: true,
+ onlyRemoveTypeImports: true,
+ },
+ ],
+ [
+ 'babel-plugin-ember-template-compilation',
+ {
+ targetFormat: 'hbs',
+ transforms: [],
+ },
+ ],
+ [
+ 'module:decorator-transforms',
+ {
+ runtime: {
+ import: 'decorator-transforms/runtime-esm',
+ },
+ },
+ ],
+ ],
+
+ generatorOpts: {
+ compact: false,
+ },
+};
diff --git a/packages/ember-input/eslint.config.mjs b/packages/ember-input/eslint.config.mjs
new file mode 100644
index 00000000..e21e77f7
--- /dev/null
+++ b/packages/ember-input/eslint.config.mjs
@@ -0,0 +1,115 @@
+import babelParser from '@babel/eslint-parser';
+import js from '@eslint/js';
+import { defineConfig, globalIgnores } from 'eslint/config';
+import prettier from 'eslint-config-prettier';
+import ember from 'eslint-plugin-ember/recommended';
+import importPlugin from 'eslint-plugin-import';
+import n from 'eslint-plugin-n';
+import globals from 'globals';
+import ts from 'typescript-eslint';
+
+const esmParserOptions = {
+ ecmaFeatures: { modules: true },
+ ecmaVersion: 'latest',
+};
+
+const tsParserOptions = {
+ projectService: true,
+ tsconfigRootDir: import.meta.dirname,
+};
+
+export default defineConfig([
+ globalIgnores(['dist/', 'dist-*/', 'declarations/', 'coverage/', '!**/.*']),
+ js.configs.recommended,
+ prettier,
+ ember.configs.base,
+ ember.configs.gjs,
+ ember.configs.gts,
+ /**
+ * https://eslint.org/docs/latest/use/configure/configuration-files#configuring-linter-options
+ */
+ {
+ linterOptions: {
+ reportUnusedDisableDirectives: 'error',
+ },
+ },
+ {
+ files: ['**/*.js'],
+ languageOptions: {
+ parser: babelParser,
+ },
+ },
+ {
+ files: ['**/*.{js,gjs}'],
+ languageOptions: {
+ parserOptions: esmParserOptions,
+ globals: {
+ ...globals.browser,
+ },
+ },
+ },
+ {
+ files: ['**/*.{ts,gts}'],
+ languageOptions: {
+ parser: ember.parser,
+ parserOptions: tsParserOptions,
+ globals: {
+ ...globals.browser,
+ },
+ },
+ extends: [
+ ...ts.configs.recommendedTypeChecked,
+ // https://github.com/ember-cli/ember-addon-blueprint/issues/119
+ {
+ ...ts.configs.eslintRecommended,
+ files: undefined,
+ },
+ ember.configs.gts,
+ ],
+ },
+ {
+ files: ['src/**/*'],
+ plugins: {
+ import: importPlugin,
+ },
+ rules: {
+ // require relative imports use full extensions
+ 'import/extensions': ['error', 'always', { ignorePackages: true }],
+ },
+ },
+ /**
+ * CJS node files
+ */
+ {
+ files: ['**/*.cjs'],
+ plugins: {
+ n,
+ },
+
+ languageOptions: {
+ sourceType: 'script',
+ ecmaVersion: 'latest',
+ globals: {
+ ...globals.node,
+ },
+ },
+ },
+ /**
+ * ESM node files
+ */
+ {
+ files: ['**/*.mjs'],
+ plugins: {
+ n,
+ },
+
+ languageOptions: {
+ sourceType: 'module',
+ ecmaVersion: 'latest',
+ parserOptions: esmParserOptions,
+ globals: {
+ ...globals.node,
+ },
+ },
+ },
+]);
diff --git a/packages/ember-input/llm.txt b/packages/ember-input/llm.txt
deleted file mode 100644
index 8c8ee7a0..00000000
--- a/packages/ember-input/llm.txt
+++ /dev/null
@@ -1,361 +0,0 @@
-# @triptyk/ember-input
-
-A collection of composable Ember input components for building forms.
-
-## Installation
-
-```bash
-ember install @triptyk/ember-input
-```
-
-Install peer dependencies if needed:
-
-```bash
-ember install ember-flatpickr
-```
-
-## Importing Types
-
-Add the Glint template-registry to your global.d.ts file:
-
-```ts
-import '@glint/environment-ember-loose';
-import type EmberInputRegistry from '@triptyk/ember-input/template-registry';
-
-declare module '@glint/environment-ember-loose/registry' {
- export default interface Registry
- extends EmberInputRegistry {}
-}
-```
-
-## HTML Naming Conventions
-
-Every component has an HTML element with a class assigned to it. The naming follows this rule:
-
-**Path of the component to kebab case**
-
-Examples:
-- ``: .tpk-input
-- ``: .tpk-input-label
-- ``: .tpk-input-input
-
-Use the `@classless` argument to prevent the base class from being applied.
-
-## Components
-
-### TpkInput
-
-A composable HTML input element.
-
-**Usage:**
-```hbs
-
-
-
-
-```
-
-**Arguments:**
-- `@value`: String - The input value
-- `@onChange`: Function - Callback when value changes (receives value and event)
-- `@changeEvent`: 'input' | 'change' - Which event triggers onChange
-- `@label`: String - Label text
-- `@classless`: Boolean - Override default CSS classes
-
-**Yields:**
-- `I.Label`: Label component
-- `I.Input`: Input component
-
-### TpkButton
-
-A button component that performs an onClick task with spam prevention.
-
-**Usage:**
-```hbs
-
- Click me
-
-```
-
-**Arguments:**
-- `@onClick`: Function - Task to execute on click
-- `@allowSpam`: Boolean - If false (default), prevents spam clicks by waiting for current task to finish
-
-### TpkCheckbox
-
-A composable checkbox input element.
-
-**Usage:**
-```hbs
-
-
-
-
-```
-
-**Arguments:**
-- `@checked`: Boolean - Checked state
-- `@onChange`: Function - Callback when value changes
-- `@label`: String - Label text
-- `@classless`: Boolean - Override default CSS classes
-
-**Yields:**
-- `C.Label`: Label component
-- `C.Input`: Checkbox input component
-
-**CSS Classes:**
-- `.tpk-checkbox-input`: Main checkbox container
-- `.tpk-checkbox-label`: Label styling
-
-### TpkSelect
-
-A select component with custom styling and options.
-
-**Usage:**
-```hbs
-
-
-
- {{if S.hasSelection S.selected "..."}}
-
-
-
- {{opt.option}}
-
-
-
-```
-
-**Arguments:**
-- `@options`: Array - Array of options
-- `@selected`: Any - Currently selected value(s)
-- `@onChange`: Function - Callback when selection changes
-- `@label`: String - Label text
-- `@multiple`: Boolean - Allow multiple selections (stores in array)
-- `@classless`: Boolean - Override default CSS classes
-
-**Yields:**
-- `S.Label`: Label component
-- `S.Button`: Button that opens the dropdown
-- `S.Options`: Options list
-- `S.hasSelection`: Boolean indicating if there's a selection
-- `S.selected`: Current selection value
-
-### TpkRadio
-
-A composable radio input element.
-
-**Usage:**
-```hbs
-
-
-
-
-```
-
-**Arguments:**
-- `@label`: String - Label text
-- `@selected`: String - Which value is selected (set on at least one radio in group)
-- `@value`: String - Value of this radio option
-- `@name`: String - Group name (must be identical for all radios in group)
-- `@onChange`: Function - Callback when selection changes
-- `@classless`: Boolean - Override default CSS classes
-
-**Yields:**
-- `C.Input`: Radio input component
-- `C.Label`: Label component
-
-### TpkFile
-
-A file input component for handling file uploads.
-
-**Usage:**
-```hbs
-
-
-
-
-```
-
-**Arguments:**
-- `@accept`: String - File types to accept (e.g., "image/*")
-- `@disabled`: Boolean - Disable the input
-- `@multiple`: Boolean - Allow multiple file selection
-- `@changeEvent`: 'input' | 'change' - Which event triggers onChange (required)
-- `@onChange`: Function (Event) => void - Callback when files change (required)
-- `@label`: String - Label text
-- `@classless`: Boolean - Override default CSS classes
-
-**Yields:**
-- `I.Label`: Label component
-- `I.Input`: File input component
-
-### TpkTextarea
-
-A composable textarea input element with character counting.
-
-**Usage:**
-```hbs
-
-
-
-
- {{C.charCount}} / {{C.maxLength}}
-
-
-
-
-```
-
-**Arguments:**
-- `@value`: String - Textarea content
-- `@onChange`: Function - Callback when value changes (receives value and event)
-- `@maxLength`: Number - Maximum character length
-- `@changeEvent`: 'input' | 'change' - Which event triggers onChange
-- `@label`: String - Label text
-- `@classless`: Boolean - Override default CSS classes
-
-**Yields:**
-- `C.Label`: Label component
-- `C.Input`: Textarea component
-- `C.charCount`: Current character count
-- `C.maxLength`: Maximum character count
-
-**CSS Classes:**
-- `.tpk-textarea`: Main container
-- `.tpk-label`: Label styling
-- `.tpk-textarea-input`: Textarea styling
-
-### TpkDatepicker
-
-A date picker component with extensive customization options using flatpickr.
-
-**Usage:**
-```hbs
-
-
-
-
-```
-
-**Mandatory Arguments:**
-- `@value`: Date | string | undefined - Initial date value
-- `@onChange`: Function (Date[]) => void - Callback when date changes
-
-**Optional Arguments:**
-- `@disabled`: Boolean - Disable the picker
-- `@mask`: String - Input mask using IMask (e.g., 'd-m/Y')
-- `@placeholder`: String - Placeholder text
-- `@onClose`: Function - Callback when picker closes
-- `@label`: String - Label text
-- `@stepping`: Number - Minutes to step in time picker (default: 5)
-- `@mode`: 'multiple' | 'range' - Selection mode
-- `@multipleDatesSeparator`: String - Separator for multiple dates
-- `@range`: Boolean - Enable range selection (default: false)
-- `@useCurrent`: Boolean - Use current date/time as initial (default: false)
-- `@promptTimeOnDateChange`: Boolean - Show time picker after date selection
-- `@todayButton`: Boolean - Show "Today" button
-- `@clearButton`: Boolean - Show "Clear" button (default: true)
-- `@closeButton`: Boolean - Show "Close" button (default: true)
-- `@enableTime`: Boolean - Enable time selection (default: false)
-- `@noCalendar`: Boolean - Disable calendar (default: true)
-- `@enableSecond`: Boolean - Enable seconds in time picker
-- `@keepOpen`: Boolean - Keep picker open after selection
-- `@locale`: String - Locale for labels (default: 'fr')
-- `@dateFormat`: String - Display format (default: 'dd/MM/yyyy')
-- `@minDate`: Date - Minimum selectable date
-- `@maxDate`: Date - Maximum selectable date
-- `@daysOfWeekDisabled`: Array - Days to disable (0-6)
-- `@disabledTimeIntervals`: Array - Time intervals to disable
-- `@disabledDates`: Array - Specific dates to disable
-- `@enabledDates`: Array - Only these dates enabled
-- `@disabledHours`: Array - Hours to disable
-- `@enabledHours`: Array - Only these hours enabled
-- `@viewMode`: 'clock' | 'calendar' | 'months' | 'years' | 'decades' - Initial view
-- `@classless`: Boolean - Override default CSS classes
-
-**Yields:**
-- `D.Label`: Label component
-- `D.Input`: Input component
-
-**Limitations:**
-- Cannot have default value for 'range' and 'multiple' modes
-
-**Examples:**
-
-Range picker:
-```hbs
-
-
-
-
-```
-
-Time picker:
-```hbs
-
-
-
-
-```
-
-## Compatibility
-
-- Ember.js v4.8 or above
-- Embroider or ember-auto-import v2
-
-## License
-
-MIT License
diff --git a/packages/ember-input/package.json b/packages/ember-input/package.json
index 1347979b..65f85690 100644
--- a/packages/ember-input/package.json
+++ b/packages/ember-input/package.json
@@ -1,6 +1,6 @@
{
"name": "@triptyk/ember-input",
- "version": "3.0.1",
+ "version": "4.0.0-alpha.1",
"description": "This addon will give you an input in TailwindCSS with Ember",
"keywords": [
"ember-addon"
@@ -10,6 +10,9 @@
},
"license": "MIT",
"author": "Triptyk",
+ "imports": {
+ "#src/*": "./src/*"
+ },
"exports": {
".": {
"types": "./declarations/index.d.ts",
@@ -19,6 +22,7 @@
"types": "./declarations/*.d.ts",
"default": "./dist/*.js"
},
+ "./dist/*.css": "./dist/*.css",
"./addon-main.js": "./addon-main.cjs"
},
"typesVersions": {
@@ -35,80 +39,83 @@
"llm.txt"
],
"scripts": {
- "build": "concurrently 'npm:build:js' 'npm:build:types'",
- "build:clean": "rm -rf dist",
- "build:js": "rollup --config",
- "build:types": "glint --declaration",
- "lint": "concurrently 'npm:lint:*(!fix)' --names 'lint:'",
- "lint:fix": "concurrently 'npm:lint:*:fix' --names 'fix:'",
+ "build": "rollup --config",
+ "build:watch": "rollup --config --watch",
+ "format": "prettier . --cache --write",
+ "lint": "concurrently \"pnpm:lint:*(!fix)\" --names \"lint:\" --prefixColors auto",
+ "lint:fix": "concurrently \"pnpm:lint:*:fix\" --names \"fix:\" --prefixColors auto && pnpm run format",
+ "lint:format": "prettier . --cache --check",
"lint:hbs": "ember-template-lint . --no-error-on-unmatched-pattern",
"lint:hbs:fix": "ember-template-lint . --fix --no-error-on-unmatched-pattern",
"lint:js": "eslint . --cache",
"lint:js:fix": "eslint . --fix",
- "lint:types": "glint",
- "prepack": "pnpm run build",
- "start": "concurrently 'npm:start:*'",
- "start:js": "rollup --config --watch --no-watch.clearScreen",
- "start:types": "glint --declaration --watch",
- "test": "echo 'A v2 addon does not have tests, run tests in test-app'"
+ "lint:types": "ember-tsc --noEmit",
+ "prepack": "rollup --config",
+ "test": "echo \"No tests specified\" && exit 0"
},
"dependencies": {
- "@ember/render-modifiers": "catalog:",
"@ember/test-helpers": "catalog:",
"@embroider/addon-shim": "catalog:",
"@glimmer/component": "catalog:",
"@glimmer/tracking": "catalog:",
"@popperjs/core": "catalog:",
+ "decorator-transforms": "catalog:",
"ember-basic-dropdown": "catalog:",
"ember-click-outside": "catalog:",
- "ember-concurrency": "^4.0.2",
- "ember-modifier": "~4.1.0",
+ "ember-concurrency": "catalog:",
+ "ember-modifier": "catalog:",
"ember-power-select": "catalog:",
"ember-power-select-with-create": "catalog:",
- "ember-test-selectors": "~6.0.0",
+ "ember-test-selectors": "catalog:",
"focus-trap": "^7.5.4",
"font-awesome": "catalog:",
- "imask": "catalog:",
- "tracked-built-ins": "~3.3.0"
+ "imask": "catalog:"
},
"devDependencies": {
- "@babel/core": "^7.25.2",
+ "@babel/core": "catalog:",
+ "@babel/eslint-parser": "catalog:",
"@babel/plugin-proposal-class-properties": "catalog:",
"@babel/plugin-proposal-decorators": "catalog:",
"@babel/plugin-transform-class-static-block": "catalog:",
"@babel/plugin-transform-typescript": "catalog:",
"@babel/runtime": "catalog:",
+ "@ember/app-tsconfig": "catalog:",
+ "@ember/library-tsconfig": "catalog:",
"@embroider/addon-dev": "catalog:",
+ "@embroider/compat": "catalog:",
+ "@embroider/core": "catalog:",
"@eonasdan/tempus-dominus": "catalog:",
- "@glint/core": "catalog:",
- "@glint/environment-ember-loose": "catalog:",
- "@glint/environment-ember-template-imports": "catalog:",
+ "@eslint/js": "catalog:",
+ "@glint/ember-tsc": "catalog:",
"@glint/template": "catalog:",
"@rollup/plugin-babel": "catalog:",
+ "@rollup/plugin-image": "^3.0.3",
"@rollup/plugin-node-resolve": "catalog:",
"@tsconfig/ember": "catalog:",
- "@typescript-eslint/eslint-plugin": "catalog:",
- "@typescript-eslint/parser": "catalog:",
+ "@types/node": "catalog:",
"babel-plugin-ember-template-compilation": "catalog:",
"concurrently": "catalog:",
- "ember-source": "~5.12.0",
+ "ember-source": "catalog:",
"ember-template-imports": "catalog:",
- "ember-template-lint": "^5.13.0",
- "eslint": "^8.57.0",
+ "ember-template-lint": "^7.9.3",
+ "eslint": "catalog:",
"eslint-config-prettier": "catalog:",
- "eslint-plugin-ember": "^12.1.1",
+ "eslint-plugin-ember": "catalog:",
+ "eslint-plugin-import": "catalog:",
"eslint-plugin-n": "catalog:",
- "eslint-plugin-prettier": "catalog:",
+ "globals": "catalog:",
+ "postcss-import": "^16.1.1",
"prettier": "catalog:",
"prettier-plugin-ember-template-tag": "catalog:",
"rollup": "catalog:",
"rollup-plugin-copy": "catalog:",
- "rollup-plugin-glimmer-template-tag": "catalog:",
+ "rollup-plugin-postcss": "^4.0.2",
"rollup-plugin-ts": "catalog:",
"rsvp": "catalog:",
"type-fest": "catalog:",
- "typescript": "^5.5.4",
- "webpack": "^5.95.0"
+ "typescript": "catalog:",
+ "typescript-eslint": "catalog:",
+ "vite": "catalog:"
},
"publishConfig": {
"registry": "https://registry.npmjs.org"
@@ -147,7 +154,7 @@
},
"peerDependencies": {
"@eonasdan/tempus-dominus": "^6.9.10",
- "ember-source": ">=5.0.0"
+ "ember-source": ">=6.0.0"
},
"gitHead": "0e3c997a40d084fa5eb05fe7cfd042bda3de4789"
}
diff --git a/packages/ember-input/rollup.config.mjs b/packages/ember-input/rollup.config.mjs
index 9ead8219..478c9289 100644
--- a/packages/ember-input/rollup.config.mjs
+++ b/packages/ember-input/rollup.config.mjs
@@ -1,66 +1,101 @@
-import babel from '@rollup/plugin-babel';
-import copy from 'rollup-plugin-copy';
+import { babel } from '@rollup/plugin-babel';
import { Addon } from '@embroider/addon-dev/rollup';
+import { fileURLToPath } from 'node:url';
+import { resolve, dirname } from 'node:path';
+import postcss from 'rollup-plugin-postcss';
+import postcssImport from 'postcss-import';
+import image from '@rollup/plugin-image';
const addon = new Addon({
srcDir: 'src',
destDir: 'dist',
});
-export default {
- // This provides defaults that work well alongside `publicEntrypoints` below.
- // You can augment this if you need to.
- output: addon.output(),
+const rootDirectory = dirname(fileURLToPath(import.meta.url));
+const babelConfig = resolve(rootDirectory, './babel.publish.config.cjs');
+const tsConfig = resolve(rootDirectory, './tsconfig.publish.json');
- plugins: [
- // These are the modules that users should be able to import from your
- // addon. Anything not listed here may get optimized away.
- // By default all your JavaScript modules (**/*.js) will be importable.
- // But you are encouraged to tweak this to only cover the modules that make
- // up your addon's public API. Also make sure your package.json#exports
- // is aligned to the config here.
- // See https://github.com/embroider-build/embroider/blob/main/docs/v2-faq.md#how-can-i-define-the-public-exports-of-my-addon
- addon.publicEntrypoints(['**/*.js', 'index.js', 'template-registry.js']),
+export default [
+ {
+ // This provides defaults that work well alongside `publicEntrypoints` below.
+ // You can augment this if you need to.
+ output: addon.output(),
+ plugins: [
+ image(),
+ // These are the modules that users should be able to import from your
+ // addon. Anything not listed here may get optimized away.
+ // By default all your JavaScript modules (**/*.js) will be importable.
+ // But you are encouraged to tweak this to only cover the modules that make
+ // up your addon's public API. Also make sure your package.json#exports
+ // is aligned to the config here.
+ // See https://github.com/embroider-build/embroider/blob/main/docs/v2-faq.md#how-can-i-define-the-public-exports-of-my-addon
+ addon.publicEntrypoints(['**/*.js', 'index.js', 'template-registry.js']),
- // These are the modules that should get reexported into the traditional
- // "app" tree. Things in here should also be in publicEntrypoints above, but
- // not everything in publicEntrypoints necessarily needs to go here.
- addon.appReexports([
- 'components/**/*.js',
- 'helpers/**/*.js',
- 'modifiers/**/*.js',
- 'services/**/*.js',
- ]),
+ // These are the modules that should get reexported into the traditional
+ // "app" tree. Things in here should also be in publicEntrypoints above, but
+ // not everything in publicEntrypoints necessarily needs to go here.
+ addon.appReexports([
+ 'components/**/*.js',
+ 'helpers/**/*.js',
+ 'modifiers/**/*.js',
+ 'services/**/*.js',
+ ]),
- // Follow the V2 Addon rules about dependencies. Your code can import from
- // `dependencies` and `peerDependencies` as well as standard Ember-provided
- // package names.
- addon.dependencies(),
+ // Follow the V2 Addon rules about dependencies. Your code can import from
+ // `dependencies` and `peerDependencies` as well as standard Ember-provided
+ // package names.
+ addon.dependencies(),
- babel({
- extensions: ['.js', '.gjs', '.ts', '.gts'],
- babelHelpers: 'bundled',
- }),
+ // This babel config should *not* apply presets or compile away ES modules.
+ // It exists only to provide development niceties for you, like automatic
+ // template colocation.
+ //
+ // By default, this will load the actual babel config from the file
+ // babel.config.json.
+ babel({
+ extensions: ['.js', '.gjs', '.ts', '.gts'],
+ babelHelpers: 'bundled',
+ configFile: babelConfig,
+ }),
- // Ensure that standalone .hbs files are properly integrated as Javascript.
- addon.hbs(),
+ // Ensure that standalone .hbs files are properly integrated as Javascript.
+ addon.hbs(),
- // Ensure that .gjs files are properly integrated as Javascript
- addon.gjs(),
+ // Ensure that .gjs files are properly integrated as Javascript
+ addon.gjs(),
- // addons are allowed to contain imports of .css files, which we want rollup
- // to leave alone and keep in the published output.
- addon.keepAssets(['**/*.css']),
+ // Emit .d.ts declaration files
+ addon.declarations(
+ 'declarations',
+ `pnpm ember-tsc --declaration --project ${tsConfig}`,
+ ),
- // Remove leftover build artifacts when starting a new build.
- addon.clean(),
-
- // Copy Readme and License into published package
- copy({
- targets: [
- { src: '../README.md', dest: '.' },
- { src: '../LICENSE.md', dest: '.' },
- ],
- }),
- ],
-};
+ // Remove leftover build artifacts when starting a new build.
+ addon.clean(),
+ ],
+ },
+ {
+ input: 'src/app.css',
+ output: {
+ dir: 'dist',
+ assetFileNames: '[name][extname]',
+ },
+ plugins: [
+ postcss({
+ extract: 'app.css',
+ minimize: false,
+ plugins: [postcssImport({})],
+ }),
+ {
+ name: 'remove-css-js-entry',
+ generateBundle(_, bundle) {
+ for (const file of Object.keys(bundle)) {
+ if (bundle[file].type === 'chunk') {
+ delete bundle[file];
+ }
+ }
+ },
+ },
+ ],
+ },
+];
diff --git a/doc-app/public/assets/icons/search.svg b/packages/ember-input/src/assets/search.svg
similarity index 91%
rename from doc-app/public/assets/icons/search.svg
rename to packages/ember-input/src/assets/search.svg
index 9afe31b9..6bf474ec 100644
--- a/doc-app/public/assets/icons/search.svg
+++ b/packages/ember-input/src/assets/search.svg
@@ -1,3 +1,3 @@
-
+
diff --git a/packages/ember-input/src/components/base.ts b/packages/ember-input/src/components/base.ts
index 37caa710..77d28551 100644
--- a/packages/ember-input/src/components/base.ts
+++ b/packages/ember-input/src/components/base.ts
@@ -1,5 +1,6 @@
import Component from '@glimmer/component';
import { guidFor } from '@ember/object/internals';
+import type Owner from '@ember/owner';
export interface BaseUIComponentArgs {
Args: {
@@ -17,7 +18,7 @@ export abstract class BaseUIComponent<
> extends Component {
guid = guidFor(this);
- constructor(owner: unknown, args: BaseUIComponentArgs['Args']) {
+ constructor(owner: Owner, args: BaseUIComponentArgs['Args']) {
super(owner, args);
}
diff --git a/packages/ember-input/src/components/prefabs/tpk-prefab-button.css b/packages/ember-input/src/components/prefabs/tpk-prefab-button.css
index 744dbf24..9a4b4f24 100644
--- a/packages/ember-input/src/components/prefabs/tpk-prefab-button.css
+++ b/packages/ember-input/src/components/prefabs/tpk-prefab-button.css
@@ -1,7 +1,7 @@
.tpk-button-container {
- @apply btn btn-primary
+ @apply btn btn-primary;
}
.tpk-test {
- @apply btn btn-warning
-}
\ No newline at end of file
+ @apply btn btn-warning;
+}
diff --git a/packages/ember-input/src/components/prefabs/tpk-prefab-button.gts b/packages/ember-input/src/components/prefabs/tpk-prefab-button.gts
index abc13a04..6119f3f8 100644
--- a/packages/ember-input/src/components/prefabs/tpk-prefab-button.gts
+++ b/packages/ember-input/src/components/prefabs/tpk-prefab-button.gts
@@ -1,7 +1,7 @@
-import type { MergeDeep } from "type-fest";
-import type { BaseUIComponentArgs } from "../base";
-import TpkButtonComponent from "../tpk-button.gts";
-import type { TOC } from "@ember/component/template-only";
+import type { MergeDeep } from 'type-fest';
+import type { BaseUIComponentArgs } from '../base';
+import TpkButtonComponent from '../tpk-button.gts';
+import type { TOC } from '@ember/component/template-only';
export type TpkButtonPrefabSignature = {
Args: MergeDeep<
@@ -16,19 +16,19 @@ export type TpkButtonPrefabSignature = {
default: [];
};
Element: HTMLElement;
-}
+};
const TpkButtonPrefabComponent: TOC =
-
{{@label}}
-
-
-export default TpkButtonPrefabComponent;
\ No newline at end of file
+ ;
+
+export default TpkButtonPrefabComponent;
diff --git a/packages/ember-input/src/components/prefabs/tpk-search.css b/packages/ember-input/src/components/prefabs/tpk-search.css
index 9e22fb82..8c849a95 100644
--- a/packages/ember-input/src/components/prefabs/tpk-search.css
+++ b/packages/ember-input/src/components/prefabs/tpk-search.css
@@ -1,5 +1,5 @@
-.tpk-search{
- @apply input select select-primary mb-4 w-full relative
+.tpk-search {
+ @apply input select select-primary mb-4 w-full relative;
}
.tpk-search-label {
@apply label w-full absolute left-0 top-0 cursor-pointer;
@@ -10,7 +10,7 @@
}
.tpk-search-icon {
- @apply py-1 ;
+ @apply py-1;
}
.tpk-search-loader {
@@ -25,15 +25,16 @@
@keyframes around {
0% {
- transform: rotate(0deg)
+ transform: rotate(0deg);
}
100% {
- transform: rotate(360deg)
+ transform: rotate(360deg);
}
}
-.tpk-search-loader::after, .tpk-search-loader::before {
- content: "";
+.tpk-search-loader::after,
+.tpk-search-loader::before {
+ content: '';
background: white;
position: absolute;
display: inline-block;
diff --git a/packages/ember-input/src/components/prefabs/tpk-search.gts b/packages/ember-input/src/components/prefabs/tpk-search.gts
index 41bd8e9d..72f56a9b 100644
--- a/packages/ember-input/src/components/prefabs/tpk-search.gts
+++ b/packages/ember-input/src/components/prefabs/tpk-search.gts
@@ -4,6 +4,7 @@ import Component from '@glimmer/component';
import { task } from 'ember-concurrency';
import { on } from '@ember/modifier';
import TpkInputComponent from '../tpk-input.gts';
+import searchSvg from '../../assets/search.svg';
export type TpkSearchPrefabSignature = {
Args: MergeDeep<
@@ -21,56 +22,66 @@ export type TpkSearchPrefabSignature = {
};
export default class TpkSearchPrefabComponent extends Component {
- performSearch = task(this, { drop: true }, async (value: string, e: Event) => {
- e.preventDefault();
-
- return this.args.onSearch(e,value);
- });
+ performSearch = task(
+ this,
+ { drop: true },
+ // eslint-disable-next-line @typescript-eslint/require-await
+ async (value: string, e: Event) => {
+ e.preventDefault();
+
+ return this.args.onSearch(e, value);
+ },
+ );
submitSearch = (e: Event) => {
e.preventDefault();
- const form = e.target as HTMLInputElement;
+ const form = e.target as HTMLFormElement;
const input = form.querySelector('input');
- let value= '';
- if(input?.value){
- value = input?.value
+ let value = '';
+ if (input?.value) {
+ value = input?.value;
}
-
+
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
this.performSearch.perform(value, e);
};
- get labelOrDefault () {
+ get labelOrDefault() {
return this.args.label ?? '';
}
-