@praxisui/metadata-editor 1.0.0-beta.60 → 1.0.0-beta.63

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,13 +1,19 @@
1
1
  # @praxisui/metadata-editor
2
2
 
3
- ## 🔰 Exemplos / Quickstart
3
+ Editores de metadados do Praxis UI para configuracao de campos, propriedades e regras de cascata em runtime.
4
4
 
5
- Para ver esta biblioteca em funcionamento em uma aplicação completa, utilize o projeto de exemplo (Quickstart):
5
+ ## Documentation
6
6
 
7
- - Repositório: https://github.com/codexrodrigues/praxis-ui-quickstart
8
- - O Quickstart demonstra a integração das bibliotecas `@praxisui/*` em um app Angular, incluindo instalação, configuração e uso em telas reais.
7
+ - Official documentation: https://praxisui.dev
8
+ - Quickstart reference app: https://github.com/codexrodrigues/praxis-ui-quickstart
9
+ - Recommended for: hosts that need runtime metadata editing without coupling form rendering and editor concerns
9
10
 
10
- Editores de metadados (configurações de campos) do Praxis UI. Esta biblioteca não renderiza campos de formulário em runtime; ela oferece UI e serviços para editar as propriedades (metadata) dos campos, incluindo um renderizador dinâmico de editores e uma aba para gerir regras de cascata entre campos.
11
+ ## When to use
12
+
13
+ - Editar propriedades e regras de campos em runtime
14
+ - Separar a UI de edicao de metadata da renderizacao final dos componentes
15
+ - Oferecer ferramentas internas de configuracao sem expor detalhes de implementacao ao host
16
+ Esta biblioteca não renderiza campos de formulario em runtime; ela oferece UI e servicos para editar propriedades de campos, incluindo um renderizador dinamico de editores e uma aba para gerir regras de cascata entre campos.
11
17
 
12
18
  Documentação de arquitetura: `projects/praxis-metadata-editor/docs/architecture.praxis.md`.
13
19
 
@@ -1254,13 +1254,14 @@ const radioProperties = [
1254
1254
  // Geral
1255
1255
  { name: 'label', label: 'Label', editorType: 'text', group: 'Geral' },
1256
1256
  { name: 'hint', label: 'Hint', editorType: 'text', group: 'Geral' },
1257
+ { name: 'description', label: 'Descrição', editorType: 'textarea', group: 'Geral', hint: 'Texto de apoio adicional do grupo de radio.' },
1257
1258
  // Dados/Opções
1258
1259
  {
1259
- name: 'providerOptions',
1260
+ name: 'options',
1260
1261
  label: 'Opções (estáticas)',
1261
1262
  editorType: 'textarea',
1262
1263
  group: 'Dados/Opções',
1263
- hint: 'JSON: [{ "value":1, "text":"Um" }] ou linhas: valor|rótulo. Apenas uma opção pode ser selecionada.',
1264
+ hint: 'JSON: [{ "value":1, "text":"Um","description":"Ajuda","disabled":false }] ou linhas: valor|rótulo. Apenas uma opção pode ser selecionada.',
1264
1265
  },
1265
1266
  { name: 'optionLabelKey', label: 'Chave do rótulo (remoto)', editorType: 'text', group: 'Dados/Opções', hint: 'Campo exibido ao carregar via API.' },
1266
1267
  { name: 'optionValueKey', label: 'Chave do valor (remoto)', editorType: 'text', group: 'Dados/Opções', hint: 'Campo salvo como value vindo da API.' },
@@ -1268,6 +1269,19 @@ const radioProperties = [
1268
1269
  { name: 'resourcePath', label: 'Resource Path', editorType: 'text', group: 'Fonte Remota', hint: 'Endpoint para opções remotas.' },
1269
1270
  { name: 'filterCriteria', label: 'Critérios de filtro (JSON)', editorType: 'text', group: 'Fonte Remota', hint: '{ "active": true } — filtro inicial na busca remota.' },
1270
1271
  // Formato/Comportamento
1272
+ { name: 'selectionMode', label: 'Modo de seleção', editorType: 'select', group: 'Formato/Comportamento', options: [
1273
+ { value: 'single', text: 'Escolha única' },
1274
+ ], hint: 'Contrato canônico do radio group.' },
1275
+ { name: 'variant', label: 'Variante', editorType: 'select', group: 'Formato/Comportamento', options: [
1276
+ { value: 'default', text: 'Default' },
1277
+ { value: 'compact', text: 'Compacto' },
1278
+ { value: 'tiles', text: 'Tiles' },
1279
+ ] },
1280
+ { name: 'density', label: 'Densidade', editorType: 'select', group: 'Formato/Comportamento', options: [
1281
+ { value: 'compact', text: 'Compacta' },
1282
+ { value: 'comfortable', text: 'Confortável' },
1283
+ { value: 'spacious', text: 'Espaçosa' },
1284
+ ] },
1271
1285
  { name: 'layout', label: 'Layout', editorType: 'select', group: 'Formato/Comportamento', options: [
1272
1286
  { value: 'horizontal', text: 'Horizontal' },
1273
1287
  { value: 'vertical', text: 'Vertical' },
@@ -2998,15 +3012,31 @@ const checkboxGroupProperties = [
2998
3012
  // Geral
2999
3013
  { name: 'label', label: 'Label', editorType: 'text', group: 'Geral' },
3000
3014
  { name: 'hint', label: 'Hint', editorType: 'text', group: 'Geral', hint: 'Texto de ajuda exibido abaixo do campo.' },
3015
+ { name: 'description', label: 'Descrição', editorType: 'textarea', group: 'Geral', hint: 'Texto de apoio adicional para checkbox booleano/consent.' },
3001
3016
  // Ícones
3002
3017
  // (sem ícones)
3003
3018
  // Dados/Opções
3004
- { name: 'options', label: 'Opções (JSON ou linhas valor|rótulo)', editorType: 'textarea', group: 'Dados/Opções', hint: 'Ex.: [{"value":1,"text":"Um"}] ou "1|Um" em cada linha.' },
3019
+ { name: 'options', label: 'Opções (JSON ou linhas valor|rótulo)', editorType: 'textarea', group: 'Dados/Opções', hint: 'Ex.: [{"value":1,"text":"Um","description":"Ajuda","disabled":false}] ou "1|Um" em cada linha.' },
3005
3020
  { name: 'resourcePath', label: 'Recurso (remoto)', editorType: 'text', group: 'Dados/Opções', row: 'dados.remoto', inline: true, hint: 'Endpoint para carregar opções.' },
3006
3021
  { name: 'filterCriteria', label: 'Filtro (JSON)', editorType: 'textarea', group: 'Dados/Opções', hint: '{ "active": true } — filtro inicial remoto.' },
3007
3022
  { name: 'optionLabelKey', label: 'Chave rótulo', editorType: 'text', group: 'Dados/Opções', row: 'dados.keys', inline: true, hint: 'Campo exibido ao carregar da API.' },
3008
3023
  { name: 'optionValueKey', label: 'Chave valor', editorType: 'text', group: 'Dados/Opções', row: 'dados.keys', inline: true, hint: 'Campo salvo como value.' },
3009
3024
  // Formato/Comportamento
3025
+ { name: 'selectionMode', label: 'Modo de seleção', editorType: 'select', group: 'Formato/Comportamento', options: [
3026
+ { value: 'boolean', text: 'Booleano simples' },
3027
+ { value: 'multiple', text: 'Múltipla seleção' },
3028
+ ], hint: 'Define a semântica do runtime. Sem valor, o legado infere pelo conjunto de opções.' },
3029
+ { name: 'variant', label: 'Variante', editorType: 'select', group: 'Formato/Comportamento', options: [
3030
+ { value: 'default', text: 'Default' },
3031
+ { value: 'consent', text: 'Consentimento' },
3032
+ { value: 'compact', text: 'Compacto' },
3033
+ { value: 'tiles', text: 'Tiles' },
3034
+ ] },
3035
+ { name: 'density', label: 'Densidade', editorType: 'select', group: 'Formato/Comportamento', options: [
3036
+ { value: 'compact', text: 'Compacta' },
3037
+ { value: 'comfortable', text: 'Confortável' },
3038
+ { value: 'spacious', text: 'Espaçosa' },
3039
+ ] },
3010
3040
  { name: 'searchable', label: 'Pesquisável', editorType: 'checkbox', group: 'Formato/Comportamento', hint: 'Mostra campo de busca (em remoto, filtra na API).' },
3011
3041
  { name: 'selectAll', label: 'Selecionar todos', editorType: 'checkbox', group: 'Formato/Comportamento', hint: 'Inclui opção para marcar todos.' },
3012
3042
  { name: 'maxSelections', label: 'Máx. seleções', editorType: 'number', group: 'Formato/Comportamento', hint: 'Limite de itens marcados (0 = sem limite).' },
@@ -3019,6 +3049,7 @@ const checkboxGroupProperties = [
3019
3049
  { value: 'after', text: 'Depois' },
3020
3050
  ] },
3021
3051
  { name: 'indeterminate', label: 'Indeterminado', editorType: 'checkbox', group: 'Formato/Comportamento', hint: 'Mostra estado parcial (ex.: dependente de filhos).' },
3052
+ { name: 'links', label: 'Links ricos (JSON)', editorType: 'textarea', group: 'Formato/Comportamento', hint: 'Ex.: [{"label":"Política","href":"https://...","target":"_blank"}]. Usado em modo boolean/consent.' },
3022
3053
  { name: 'linkText', label: 'Texto do link', editorType: 'text', group: 'Formato/Comportamento', hint: 'Rótulo do link associado.' },
3023
3054
  { name: 'linkUrl', label: 'URL do link', editorType: 'text', group: 'Formato/Comportamento', hint: 'Ex.: https://dominio...' },
3024
3055
  { name: 'linkTarget', label: 'Alvo do link', editorType: 'select', group: 'Formato/Comportamento', options: [
@@ -3027,6 +3058,7 @@ const checkboxGroupProperties = [
3027
3058
  ] },
3028
3059
  // Validação
3029
3060
  { name: 'required', label: 'Obrigatório', editorType: 'checkbox', group: 'Validação' },
3061
+ { name: 'requiredChecked', label: 'Exigir marcado', editorType: 'checkbox', group: 'Validação', hint: 'Para consentimentos e aceite obrigatório.' },
3030
3062
  { name: 'validators.requiredMessage', label: 'Mensagem: obrigatório', editorType: 'text', group: 'Validação' },
3031
3063
  // Ações
3032
3064
  // (sem ações adicionais)
@@ -5617,7 +5649,7 @@ class FieldMetadataEditorComponent {
5617
5649
  });
5618
5650
  }
5619
5651
  catch { }
5620
- // Inject default for providerOptions from seed.options when present (radio/editor-friendly name)
5652
+ // Backward-compatible bridge: if a config still uses providerOptions, hydrate from seed.options.
5621
5653
  try {
5622
5654
  const hasProviderOptions = this.normalizedProps.some((p) => p.name === 'providerOptions');
5623
5655
  const seedOptions = this.seed?.options;
@@ -5970,6 +6002,12 @@ class FieldMetadataEditorComponent {
5970
6002
  patch.inlineTimeTrackShifts = parsedTrackShifts;
5971
6003
  }
5972
6004
  }
6005
+ if (typeof patch.links === 'string') {
6006
+ const parsedLinks = this.parseArrayTextarea(patch.links);
6007
+ if (parsedLinks) {
6008
+ patch.links = parsedLinks;
6009
+ }
6010
+ }
5973
6011
  }
5974
6012
  /**
5975
6013
  * Interpreta textarea como lista simples de strings: