@praxisui/metadata-editor 3.0.0-beta.3 → 3.0.0-beta.5
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.
|
@@ -1136,6 +1136,8 @@ const selectProperties = [
|
|
|
1136
1136
|
{ name: 'searchable', label: 'Buscável', editorType: 'checkbox', group: 'Formato/Comportamento', row: 'comp.inline1', inline: true, hint: 'Mostra campo de busca; em remoto, filtra na API.' },
|
|
1137
1137
|
{ name: 'searchPlaceholder', label: 'Placeholder da busca', editorType: 'text', group: 'Formato/Comportamento', hint: 'Texto do campo de busca no popover/lista.' },
|
|
1138
1138
|
{ name: 'maxSelections', label: 'Máximo de seleções', editorType: 'number', group: 'Formato/Comportamento', hint: 'Limite de itens quando multiple=true.' },
|
|
1139
|
+
{ name: 'readonly', label: 'Somente leitura', editorType: 'checkbox', group: 'Formato/Comportamento', row: 'comp.inline2', inline: true, hint: 'Mantém o valor visível sem permitir interação.' },
|
|
1140
|
+
{ name: 'disabled', label: 'Desabilitado', editorType: 'checkbox', group: 'Formato/Comportamento', row: 'comp.inline2', inline: true, hint: 'Desativa interação, foco e ações do trigger.' },
|
|
1139
1141
|
// 5) Validação
|
|
1140
1142
|
{ name: 'required', label: 'Obrigatório', editorType: 'checkbox', group: 'Validação' },
|
|
1141
1143
|
{ name: 'validators.requiredMessage', label: 'Mensagem: obrigatório', editorType: 'text', group: 'Validação' },
|
|
@@ -1217,6 +1219,10 @@ const transferListProperties = [
|
|
|
1217
1219
|
// Geral
|
|
1218
1220
|
{ name: 'label', label: 'Label', editorType: 'text', group: 'Geral' },
|
|
1219
1221
|
{ name: 'hint', label: 'Hint', editorType: 'text', group: 'Geral', hint: 'Texto de ajuda exibido abaixo do campo.' },
|
|
1222
|
+
{ name: 'leftLabel', label: 'Label da lista esquerda', editorType: 'text', group: 'Geral', hint: 'Titulo exibido acima dos itens disponiveis.' },
|
|
1223
|
+
{ name: 'rightLabel', label: 'Label da lista direita', editorType: 'text', group: 'Geral', hint: 'Titulo exibido acima dos itens selecionados.' },
|
|
1224
|
+
{ name: 'leftPlaceholder', label: 'Placeholder da busca esquerda', editorType: 'text', group: 'Geral', hint: 'Texto de busca da lista de itens disponiveis.' },
|
|
1225
|
+
{ name: 'rightPlaceholder', label: 'Placeholder da busca direita', editorType: 'text', group: 'Geral', hint: 'Texto de busca da lista de itens selecionados.' },
|
|
1220
1226
|
// Dados/Opções
|
|
1221
1227
|
{
|
|
1222
1228
|
name: 'options',
|
|
@@ -2086,11 +2092,6 @@ const timeInputProperties = [
|
|
|
2086
2092
|
{ name: 'prefixIconColor', label: 'Cor do ícone (prefixo)', editorType: 'color', group: 'Ícones', hint: 'primary, accent, warn ou hex/rgb (ex.: #ff0000).' },
|
|
2087
2093
|
{ name: 'suffixIcon', label: 'Ícone (sufixo)', editorType: 'text', group: 'Ícones', hint: 'Nome do ícone Material Symbols (ex.: mi:info).' },
|
|
2088
2094
|
{ name: 'suffixIconColor', label: 'Cor do ícone (sufixo)', editorType: 'color', group: 'Ícones', hint: 'primary, accent, warn ou hex/rgb (ex.: #ff0000).' },
|
|
2089
|
-
{ name: 'panelToggleCloseIcon', label: 'Ícone toggle fechado', editorType: 'text', group: 'Ícones', row: 'icon.toggle', inline: true, hint: 'Ícone do botão quando painel está fechado (fallback: expand_more).' },
|
|
2090
|
-
{ name: 'panelToggleOpenIcon', label: 'Ícone toggle aberto', editorType: 'text', group: 'Ícones', row: 'icon.toggle', inline: true, hint: 'Ícone do botão quando painel está aberto (fallback: expand_less).' },
|
|
2091
|
-
{ name: 'panelToggleIconColor', label: 'Cor do toggle', editorType: 'color', group: 'Ícones', row: 'icon.toggle', inline: true, hint: 'primary/accent/warn ou cor CSS.' },
|
|
2092
|
-
{ name: 'optionSelectedIcon', label: 'Ícone selecionado', editorType: 'text', group: 'Ícones', row: 'icon.selected', inline: true, hint: 'Ícone da opção selecionada na lista (fallback: check).' },
|
|
2093
|
-
{ name: 'optionSelectedIconColor', label: 'Cor selecionado', editorType: 'color', group: 'Ícones', row: 'icon.selected', inline: true, hint: 'primary/accent/warn ou cor CSS.' },
|
|
2094
2095
|
// Formato/Comportamento
|
|
2095
2096
|
{ name: 'step', label: 'Step (segundos)', editorType: 'number', group: 'Formato/Comportamento', hint: 'Incremento em segundos (ex.: 60 = 1 min).' },
|
|
2096
2097
|
{ name: 'interval', label: 'Intervalo (segundos ou 30m)', editorType: 'text', group: 'Formato/Comportamento', hint: 'Compatibilidade inline: intervalo entre horários.' },
|
|
@@ -2194,11 +2195,6 @@ const timePickerProperties = [
|
|
|
2194
2195
|
{ name: 'prefixIconColor', label: 'Cor do ícone (prefixo)', editorType: 'color', group: 'Ícones', hint: 'Tema (primary/accent/warn) ou cor CSS (hex/rgb).' },
|
|
2195
2196
|
{ name: 'suffixIcon', label: 'Ícone (sufixo)', editorType: 'text', group: 'Ícones', hint: 'Nome do ícone Material Symbols (ex.: mi:info).' },
|
|
2196
2197
|
{ name: 'suffixIconColor', label: 'Cor do ícone (sufixo)', editorType: 'color', group: 'Ícones', hint: 'Tema (primary/accent/warn) ou cor CSS (hex/rgb).' },
|
|
2197
|
-
{ name: 'panelToggleCloseIcon', label: 'Ícone toggle fechado', editorType: 'text', group: 'Ícones', row: 'icon.toggle', inline: true, hint: 'Ícone do botão quando painel está fechado (fallback: expand_more).' },
|
|
2198
|
-
{ name: 'panelToggleOpenIcon', label: 'Ícone toggle aberto', editorType: 'text', group: 'Ícones', row: 'icon.toggle', inline: true, hint: 'Ícone do botão quando painel está aberto (fallback: expand_less).' },
|
|
2199
|
-
{ name: 'panelToggleIconColor', label: 'Cor do toggle', editorType: 'color', group: 'Ícones', row: 'icon.toggle', inline: true, hint: 'Tema (primary/accent/warn) ou cor CSS.' },
|
|
2200
|
-
{ name: 'optionSelectedIcon', label: 'Ícone selecionado', editorType: 'text', group: 'Ícones', row: 'icon.selected', inline: true, hint: 'Ícone da opção selecionada na lista (fallback: check).' },
|
|
2201
|
-
{ name: 'optionSelectedIconColor', label: 'Cor selecionado', editorType: 'color', group: 'Ícones', row: 'icon.selected', inline: true, hint: 'Tema (primary/accent/warn) ou cor CSS.' },
|
|
2202
2198
|
// Dados/Opções
|
|
2203
2199
|
{ name: 'timeOptions', label: 'Opções (uma por linha)', editorType: 'textarea', group: 'Dados/Opções', hint: 'Lista manual de horários (HH:mm ou HH:mm:ss), um por linha; use para presets.' },
|
|
2204
2200
|
// Formato/Comportamento
|
|
@@ -2233,6 +2229,8 @@ const timePickerProperties = [
|
|
|
2233
2229
|
{ name: 'showSeconds', label: 'Exibir segundos', editorType: 'checkbox', group: 'Formato/Comportamento', hint: 'Habilita seleção HH:mm:ss.' },
|
|
2234
2230
|
{ name: 'stepMinute', label: 'Passo (min)', editorType: 'number', group: 'Formato/Comportamento', row: 'fmt.steps', inline: true, hint: 'Incremento de minutos.' },
|
|
2235
2231
|
{ name: 'stepSecond', label: 'Passo (seg)', editorType: 'number', group: 'Formato/Comportamento', row: 'fmt.steps', inline: true, hint: 'Incremento de segundos.' },
|
|
2232
|
+
{ name: 'readonly', label: 'Somente leitura', editorType: 'checkbox', group: 'Formato/Comportamento', row: 'fmt.state', inline: true, hint: 'Mantém o horário visível sem abrir o seletor.' },
|
|
2233
|
+
{ name: 'disabled', label: 'Desabilitado', editorType: 'checkbox', group: 'Formato/Comportamento', row: 'fmt.state', inline: true, hint: 'Desativa trigger, foco e abertura do painel.' },
|
|
2236
2234
|
{ name: 'timeFilter', label: 'Filtro (id função)', editorType: 'text', group: 'Formato/Comportamento', hint: 'ID de função para filtrar horários.' },
|
|
2237
2235
|
{ name: 'inlineTexts.hourLabel', label: 'Inline: rótulo hora', editorType: 'text', group: 'Formato/Comportamento' },
|
|
2238
2236
|
{ name: 'inlineTexts.minuteLabel', label: 'Inline: rótulo minuto', editorType: 'text', group: 'Formato/Comportamento' },
|
|
@@ -2538,6 +2536,17 @@ const passwordInputProperties = [
|
|
|
2538
2536
|
{ name: 'ariaLabelledby', label: 'ARIA labelledby', editorType: 'text', group: 'Acessibilidade', hint: 'ID de elemento que atua como label.' },
|
|
2539
2537
|
{ name: 'tabIndex', label: 'TabIndex', editorType: 'number', group: 'Acessibilidade' },
|
|
2540
2538
|
// Ações
|
|
2539
|
+
{ name: 'revealToggle.enabled', label: 'Reveal: habilitar', editorType: 'checkbox', group: 'Ações', hint: 'Mostra botão para alternar a visibilidade da senha.' },
|
|
2540
|
+
{ name: 'revealToggle.style', label: 'Reveal: estilo', editorType: 'select', group: 'Ações', options: [
|
|
2541
|
+
{ value: 'icon', text: 'Ícone' },
|
|
2542
|
+
{ value: 'text', text: 'Texto' },
|
|
2543
|
+
] },
|
|
2544
|
+
{ name: 'revealToggle.showLabel', label: 'Reveal: label (mostrar)', editorType: 'text', group: 'Ações', hint: 'Usado quando o estilo estiver em texto.' },
|
|
2545
|
+
{ name: 'revealToggle.hideLabel', label: 'Reveal: label (ocultar)', editorType: 'text', group: 'Ações', hint: 'Usado quando o estilo estiver em texto.' },
|
|
2546
|
+
{ name: 'revealToggle.iconShow', label: 'Reveal: ícone (mostrar)', editorType: 'text', group: 'Ações', hint: "Material Symbols (ex.: mi:visibility). Use o seletor ao lado para buscar." },
|
|
2547
|
+
{ name: 'revealToggle.iconHide', label: 'Reveal: ícone (ocultar)', editorType: 'text', group: 'Ações', hint: "Material Symbols (ex.: mi:visibility_off). Use o seletor ao lado para buscar." },
|
|
2548
|
+
{ name: 'revealToggle.tooltip', label: 'Reveal: tooltip', editorType: 'text', group: 'Ações' },
|
|
2549
|
+
{ name: 'revealToggle.ariaLabel', label: 'Reveal: aria-label', editorType: 'text', group: 'Ações', hint: 'Descreve a ação do botão para leitores de tela.' },
|
|
2541
2550
|
{ name: 'clearButton.enabled', label: 'Clear: habilitar', editorType: 'checkbox', group: 'Ações', hint: 'Mostra botão para limpar valor.' },
|
|
2542
2551
|
{ name: 'clearButton.icon', label: 'Clear: ícone', editorType: 'text', group: 'Ações', hint: "Material Symbols (ex.: mi:clear). Use o seletor ao lado para buscar." },
|
|
2543
2552
|
{ name: 'clearButton.iconColor', label: 'Clear: cor do ícone', editorType: 'color', group: 'Ações', hint: 'primary/accent/warn ou cor CSS (ex.: #496ddb, rgb(73,109,219), red)' },
|
|
@@ -3177,6 +3186,8 @@ const rangeSliderProperties = [
|
|
|
3177
3186
|
{ value: 'auto', text: 'Auto' },
|
|
3178
3187
|
], hint: 'Marcas na trilha; auto calcula com base no step.' },
|
|
3179
3188
|
{ name: 'discrete', label: 'Discreto', editorType: 'checkbox', group: 'Formato/Comportamento', hint: 'Mostra valor fixo por tick; use com showTicks.' },
|
|
3189
|
+
{ name: 'readonly', label: 'Somente leitura', editorType: 'checkbox', group: 'Formato/Comportamento', row: 'comp.state', inline: true, hint: 'Mantém o valor renderizado sem permitir ajuste do slider.' },
|
|
3190
|
+
{ name: 'disabled', label: 'Desabilitado', editorType: 'checkbox', group: 'Formato/Comportamento', row: 'comp.state', inline: true, hint: 'Desativa arraste, foco e presets rápidos.' },
|
|
3180
3191
|
{ name: 'vertical', label: 'Vertical', editorType: 'checkbox', group: 'Formato/Comportamento', hint: 'Inverte para eixo Y.' },
|
|
3181
3192
|
{ name: 'invert', label: 'Inverter', editorType: 'checkbox', group: 'Formato/Comportamento', hint: 'Inverte a direção (direita→esquerda).' },
|
|
3182
3193
|
{ name: 'displayWith', label: 'DisplayWith (id função)', editorType: 'text', group: 'Formato/Comportamento', hint: 'Função para formatar valores (ex.: percentual).' },
|
|
@@ -5419,9 +5430,108 @@ class FieldMetadataEditorComponent {
|
|
|
5419
5430
|
catch { }
|
|
5420
5431
|
this.rebuildEditorForType(this.controlType);
|
|
5421
5432
|
}
|
|
5433
|
+
resolveCanonicalEditorProperties(controlType, controlTypeToken) {
|
|
5434
|
+
const inlineProps = resolveInlineFilterEditorProperties(controlTypeToken);
|
|
5435
|
+
if (inlineProps?.length)
|
|
5436
|
+
return inlineProps;
|
|
5437
|
+
if (controlType === FieldControlType.INPUT)
|
|
5438
|
+
return inputProperties;
|
|
5439
|
+
if (controlTypeToken === 'searchableselect' ||
|
|
5440
|
+
controlTypeToken === 'asyncselect' ||
|
|
5441
|
+
controlTypeToken === 'entitylookup')
|
|
5442
|
+
return selectProperties;
|
|
5443
|
+
if (controlType === FieldControlType.NUMERIC_TEXT_BOX)
|
|
5444
|
+
return numberProperties;
|
|
5445
|
+
if (controlType === FieldControlType.DATE_PICKER)
|
|
5446
|
+
return dateProperties;
|
|
5447
|
+
if (controlType === FieldControlType.DATE_INPUT)
|
|
5448
|
+
return dateInputProperties;
|
|
5449
|
+
if (controlType === FieldControlType.DATE_RANGE)
|
|
5450
|
+
return dateRangeProperties;
|
|
5451
|
+
if (controlType === FieldControlType.DATETIME_LOCAL_INPUT)
|
|
5452
|
+
return datetimeLocalProperties;
|
|
5453
|
+
if (controlType === FieldControlType.TIME_INPUT)
|
|
5454
|
+
return timeInputProperties;
|
|
5455
|
+
if (controlType === FieldControlType.TIME_PICKER)
|
|
5456
|
+
return timePickerProperties;
|
|
5457
|
+
if (controlType === FieldControlType.TIME_RANGE)
|
|
5458
|
+
return timeRangeProperties;
|
|
5459
|
+
if (controlType === FieldControlType.MONTH_INPUT)
|
|
5460
|
+
return monthInputProperties;
|
|
5461
|
+
if (controlType === FieldControlType.WEEK_INPUT)
|
|
5462
|
+
return weekInputProperties;
|
|
5463
|
+
if (controlType === FieldControlType.EMAIL_INPUT)
|
|
5464
|
+
return emailInputProperties;
|
|
5465
|
+
if (controlType === FieldControlType.PASSWORD)
|
|
5466
|
+
return passwordInputProperties;
|
|
5467
|
+
if (controlType === FieldControlType.URL_INPUT)
|
|
5468
|
+
return urlInputProperties;
|
|
5469
|
+
if (controlType === FieldControlType.SEARCH_INPUT)
|
|
5470
|
+
return searchInputProperties;
|
|
5471
|
+
if (controlType === FieldControlType.PHONE)
|
|
5472
|
+
return phoneInputProperties;
|
|
5473
|
+
if (controlType === FieldControlType.COLOR_INPUT)
|
|
5474
|
+
return colorInputProperties;
|
|
5475
|
+
if (controlType === FieldControlType.COLOR_PICKER)
|
|
5476
|
+
return colorPickerProperties;
|
|
5477
|
+
if (controlType === FieldControlType.RATING)
|
|
5478
|
+
return ratingProperties;
|
|
5479
|
+
if (controlType === FieldControlType.SELECT ||
|
|
5480
|
+
controlType === FieldControlType.MULTI_SELECT ||
|
|
5481
|
+
controlType === FieldControlType.SEARCHABLE_SELECT ||
|
|
5482
|
+
controlType === FieldControlType.ASYNC_SELECT ||
|
|
5483
|
+
controlType === FieldControlType.AUTO_COMPLETE ||
|
|
5484
|
+
controlType === FieldControlType.SELECTION_LIST)
|
|
5485
|
+
return selectProperties;
|
|
5486
|
+
if (controlType === FieldControlType.TEXTAREA)
|
|
5487
|
+
return textareaProperties;
|
|
5488
|
+
if (controlType === FieldControlType.TRANSFER_LIST)
|
|
5489
|
+
return transferListProperties;
|
|
5490
|
+
if (controlType === FieldControlType.RADIO)
|
|
5491
|
+
return radioProperties;
|
|
5492
|
+
if (controlType === FieldControlType.BUTTON_TOGGLE)
|
|
5493
|
+
return buttonToggleProperties;
|
|
5494
|
+
if (controlType === FieldControlType.CHIP_INPUT)
|
|
5495
|
+
return chipInputProperties;
|
|
5496
|
+
if (controlType === FieldControlType.CHECKBOX)
|
|
5497
|
+
return checkboxGroupProperties;
|
|
5498
|
+
if (controlType === FieldControlType.TOGGLE)
|
|
5499
|
+
return toggleProperties;
|
|
5500
|
+
if (controlType === FieldControlType.SLIDER)
|
|
5501
|
+
return sliderProperties;
|
|
5502
|
+
if (controlType === FieldControlType.RANGE_SLIDER)
|
|
5503
|
+
return rangeSliderProperties;
|
|
5504
|
+
if (controlType === FieldControlType.CURRENCY_INPUT)
|
|
5505
|
+
return currencyInputProperties;
|
|
5506
|
+
if (controlType === FieldControlType.PRICE_RANGE)
|
|
5507
|
+
return priceRangeProperties;
|
|
5508
|
+
if (controlType === FieldControlType.CPF_CNPJ_INPUT)
|
|
5509
|
+
return cpfCnpjProperties;
|
|
5510
|
+
if (controlType === FieldControlType.FILE_UPLOAD)
|
|
5511
|
+
return fileUploadProperties;
|
|
5512
|
+
if (controlType === FieldControlType.YEAR_INPUT)
|
|
5513
|
+
return yearInputProperties;
|
|
5514
|
+
if (controlType === FieldControlType.AVATAR)
|
|
5515
|
+
return avatarProperties;
|
|
5516
|
+
if (controlType === FieldControlType.TREE_SELECT ||
|
|
5517
|
+
controlType === FieldControlType.MULTI_SELECT_TREE)
|
|
5518
|
+
return treeSelectProperties;
|
|
5519
|
+
return undefined;
|
|
5520
|
+
}
|
|
5422
5521
|
rebuildEditorForType(ct) {
|
|
5423
5522
|
this.controlType = ct;
|
|
5424
5523
|
let props = this.registry.getProperties(this.controlType);
|
|
5524
|
+
const controlTypeToken = normalizeControlTypeToken(this.controlType);
|
|
5525
|
+
const canonicalProps = this.resolveCanonicalEditorProperties(this.controlType, controlTypeToken);
|
|
5526
|
+
if (canonicalProps?.length) {
|
|
5527
|
+
const currentPropNames = new Set(props.map((prop) => prop.name));
|
|
5528
|
+
const hasInlineConfigDrift = !props.length ||
|
|
5529
|
+
canonicalProps.some((inlineProp) => !currentPropNames.has(inlineProp.name));
|
|
5530
|
+
if (hasInlineConfigDrift) {
|
|
5531
|
+
this.registry.register(this.controlType, canonicalProps);
|
|
5532
|
+
props = canonicalProps;
|
|
5533
|
+
}
|
|
5534
|
+
}
|
|
5425
5535
|
try {
|
|
5426
5536
|
(console.log || console.debug)('[FieldMetadataEditor] init', {
|
|
5427
5537
|
controlType: this.controlType,
|
|
@@ -5440,14 +5550,12 @@ class FieldMetadataEditorComponent {
|
|
|
5440
5550
|
}
|
|
5441
5551
|
catch { }
|
|
5442
5552
|
// Fallback de registro mínimo para facilitar execução inicial
|
|
5553
|
+
if (!props.length && canonicalProps?.length) {
|
|
5554
|
+
this.registry.register(this.controlType, canonicalProps);
|
|
5555
|
+
props = canonicalProps;
|
|
5556
|
+
}
|
|
5443
5557
|
if (!props.length) {
|
|
5444
|
-
|
|
5445
|
-
const inlineProps = resolveInlineFilterEditorProperties(controlTypeToken);
|
|
5446
|
-
if (inlineProps) {
|
|
5447
|
-
this.registry.register(this.controlType, inlineProps);
|
|
5448
|
-
props = inlineProps;
|
|
5449
|
-
}
|
|
5450
|
-
else if (this.controlType === FieldControlType.INPUT) {
|
|
5558
|
+
if (this.controlType === FieldControlType.INPUT) {
|
|
5451
5559
|
this.registry.register(this.controlType, inputProperties);
|
|
5452
5560
|
props = inputProperties;
|
|
5453
5561
|
}
|