@wrrdev/fenix-ui 1.1.16 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -3
- package/dist/components/autocomplete/autocomplete.d.ts +3 -1
- package/dist/components/autocomplete/autocomplete.d.ts.map +1 -1
- package/dist/components/autocomplete/autocomplete.js +7 -1
- package/dist/components/autocomplete/autocomplete.js.map +1 -1
- package/dist/components/avatar/avatar.d.ts +1 -0
- package/dist/components/avatar/avatar.d.ts.map +1 -1
- package/dist/components/avatar/avatar.js +3 -0
- package/dist/components/avatar/avatar.js.map +1 -1
- package/dist/components/badge/badge.d.ts +4 -0
- package/dist/components/badge/badge.d.ts.map +1 -1
- package/dist/components/badge/badge.js +12 -0
- package/dist/components/badge/badge.js.map +1 -1
- package/dist/components/button/button.d.ts +2 -0
- package/dist/components/button/button.d.ts.map +1 -1
- package/dist/components/button/button.js +6 -0
- package/dist/components/button/button.js.map +1 -1
- package/dist/components/card/card.d.ts +2 -0
- package/dist/components/card/card.d.ts.map +1 -1
- package/dist/components/card/card.js +6 -0
- package/dist/components/card/card.js.map +1 -1
- package/dist/components/checkbox/checkbox.d.ts +5 -1
- package/dist/components/checkbox/checkbox.d.ts.map +1 -1
- package/dist/components/checkbox/checkbox.js +7 -8
- package/dist/components/checkbox/checkbox.js.map +1 -1
- package/dist/components/datepicker/datepicker.d.ts +17 -2
- package/dist/components/datepicker/datepicker.d.ts.map +1 -1
- package/dist/components/datepicker/datepicker.js +113 -42
- package/dist/components/datepicker/datepicker.js.map +1 -1
- package/dist/components/dialog/dialog.d.ts +4 -1
- package/dist/components/dialog/dialog.d.ts.map +1 -1
- package/dist/components/dialog/dialog.js +41 -18
- package/dist/components/dialog/dialog.js.map +1 -1
- package/dist/components/drawer/drawer.d.ts +5 -1
- package/dist/components/drawer/drawer.d.ts.map +1 -1
- package/dist/components/drawer/drawer.js +39 -17
- package/dist/components/drawer/drawer.js.map +1 -1
- package/dist/components/fileupload/fileupload.d.ts +13 -1
- package/dist/components/fileupload/fileupload.d.ts.map +1 -1
- package/dist/components/fileupload/fileupload.js +29 -1
- package/dist/components/fileupload/fileupload.js.map +1 -1
- package/dist/components/floatlabel/floatlabel.d.ts +20 -0
- package/dist/components/floatlabel/floatlabel.d.ts.map +1 -1
- package/dist/components/floatlabel/floatlabel.js +99 -26
- package/dist/components/floatlabel/floatlabel.js.map +1 -1
- package/dist/components/icon/icon.d.ts +4 -0
- package/dist/components/icon/icon.d.ts.map +1 -1
- package/dist/components/icon/icon.js +12 -0
- package/dist/components/icon/icon.js.map +1 -1
- package/dist/components/input/input.d.ts +9 -2
- package/dist/components/input/input.d.ts.map +1 -1
- package/dist/components/input/input.js +56 -8
- package/dist/components/input/input.js.map +1 -1
- package/dist/components/multiselect/multiselect.d.ts +8 -1
- package/dist/components/multiselect/multiselect.d.ts.map +1 -1
- package/dist/components/multiselect/multiselect.js +61 -9
- package/dist/components/multiselect/multiselect.js.map +1 -1
- package/dist/components/orderlist/orderlist.d.ts +7 -0
- package/dist/components/orderlist/orderlist.d.ts.map +1 -1
- package/dist/components/orderlist/orderlist.js +34 -2
- package/dist/components/orderlist/orderlist.js.map +1 -1
- package/dist/components/radio/radio.d.ts +6 -0
- package/dist/components/radio/radio.d.ts.map +1 -1
- package/dist/components/radio/radio.js +12 -6
- package/dist/components/radio/radio.js.map +1 -1
- package/dist/components/select/select.d.ts +19 -1
- package/dist/components/select/select.d.ts.map +1 -1
- package/dist/components/select/select.js +116 -10
- package/dist/components/select/select.js.map +1 -1
- package/dist/components/switch/switch.d.ts +4 -1
- package/dist/components/switch/switch.d.ts.map +1 -1
- package/dist/components/switch/switch.js +2 -1
- package/dist/components/switch/switch.js.map +1 -1
- package/dist/components/table/table.d.ts +27 -0
- package/dist/components/table/table.d.ts.map +1 -1
- package/dist/components/table/table.js +119 -21
- package/dist/components/table/table.js.map +1 -1
- package/dist/components/tabs/tabs.d.ts +6 -0
- package/dist/components/tabs/tabs.d.ts.map +1 -1
- package/dist/components/tabs/tabs.js +34 -0
- package/dist/components/tabs/tabs.js.map +1 -1
- package/dist/components/textarea/textarea.d.ts +5 -1
- package/dist/components/textarea/textarea.d.ts.map +1 -1
- package/dist/components/textarea/textarea.js +25 -6
- package/dist/components/textarea/textarea.js.map +1 -1
- package/dist/core/jsx.d.ts +11 -5
- package/dist/core/jsx.d.ts.map +1 -1
- package/dist/core/jsx.js.map +1 -1
- package/dist/core/modal.d.ts +31 -0
- package/dist/core/modal.d.ts.map +1 -0
- package/dist/core/modal.js +61 -0
- package/dist/core/modal.js.map +1 -0
- package/dist/core/tokens.d.ts +2 -0
- package/dist/core/tokens.d.ts.map +1 -1
- package/dist/core/tokens.js +9 -0
- package/dist/core/tokens.js.map +1 -1
- package/dist/docs/app.d.ts.map +1 -1
- package/dist/docs/componentes/floatlabel.doc.d.ts.map +1 -1
- package/dist/docs/componentes/input.doc.d.ts.map +1 -1
- package/dist/docs/componentes/orderlist.doc.d.ts.map +1 -1
- package/dist/docs/componentes/table.doc.d.ts.map +1 -1
- package/dist/docs/shell.d.ts +10 -1
- package/dist/docs/shell.d.ts.map +1 -1
- package/dist/docs/theme-reference.d.ts +53 -0
- package/dist/docs/theme-reference.d.ts.map +1 -0
- package/dist/docs/types.d.ts +2 -0
- package/dist/docs/types.d.ts.map +1 -1
- package/dist/fenix-ui.umd.min.js +270 -233
- package/dist/fenix-ui4.esm.js +890 -176
- package/dist/fenix-ui4.esm.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch.js","sources":["../../../src/components/switch/switch.ts"],"sourcesContent":["import { FxFormElement } from '../../core/form-element';\nimport { css } from '../../core/css';\nimport { defineElement } from '../../core/define';\n\n/**\n * <fx-switch> — Interruptor ligado/desligado (role=\"switch\").\n *\n * Form-Associated Custom Element: dentro de um <form> entra no FormData\n * (via atributo `name`) com `value` (ou 'on') quando ligado — desligado\n * não envia nada, igual ao checkbox. Recebe reset/disable do form.\n *\n * O texto do slot (light DOM) é o rótulo clicável.\n * Atributos: checked, disabled, value, name, size (sm|md|lg).\n * Eventos: `change` e `checkedChange` (composed, detail: { checked, value }) —\n * `checkedChange` é o two-way binding do Angular [(checked)].\n */\nexport class FxSwitch extends FxFormElement {\n static override styles = css`\n :host {\n display: inline-flex;\n vertical-align: middle;\n font-family: var(--fx-font-family);\n font-size: var(--fx-font-size);\n }\n .switch {\n display: inline-flex;\n align-items: center;\n gap: var(--fx-space-sm);\n cursor: pointer;\n user-select: none;\n background: none;\n border: none;\n padding: 0;\n color: var(--fx-text-default);\n font: inherit;\n }\n .track {\n position: relative;\n width: 40px;\n height: 22px;\n border-radius: var(--fx-radius-full);\n background: var(--fx-border-default);\n flex-shrink: 0;\n transition: background-color var(--fx-motion-duration-normal) var(--fx-motion-easing);\n }\n .thumb {\n position: absolute;\n top: 3px;\n left: 3px;\n width: 16px;\n height: 16px;\n border-radius: var(--fx-radius-full);\n background: #fff;\n box-shadow: var(--fx-shadow-sm);\n transition: transform var(--fx-motion-duration-normal) var(--fx-motion-easing);\n }\n :host([checked]) .track { background: var(--fx-color-primary); }\n :host([checked]) .thumb { transform: translateX(18px); }\n .switch:focus-visible .track {\n outline: none;\n box-shadow: var(--fx-effect-focus-ring, none);\n }\n .label { display: inline-flex; align-items: center; }\n :host([disabled]) .switch { opacity: 0.55; cursor: not-allowed; pointer-events: none; }\n /* Escala: sm 32×18 · md 40×22 (padrão) · lg 48×26 */\n :host([size='sm']) .track { width: 32px; height: 18px; }\n :host([size='sm']) .thumb { top: 2px; left: 2px; width: 14px; height: 14px; }\n :host([size='sm'][checked]) .thumb { transform: translateX(14px); }\n :host([size='lg']) .track { width: 48px; height: 26px; }\n :host([size='lg']) .thumb { top: 4px; left: 4px; width: 18px; height: 18px; }\n :host([size='lg'][checked]) .thumb { transform: translateX(22px); }\n `;\n\n static override get observedAttributes(): string[] {\n return ['checked', 'disabled', 'size'];\n }\n\n /** Tamanho da trilha. Padrão: `'md'`. */\n get size(): string {\n const s = this.getAttr('size', 'md');\n return s === 'sm' || s === 'lg' ? s : 'md';\n }\n set size(value: string) {\n this.setAttribute('size', value);\n }\n\n get checked(): boolean {\n return this.hasAttr('checked');\n }\n set checked(value: boolean) {\n this.toggleAttr('checked', Boolean(value));\n }\n\n get disabled(): boolean {\n return this.hasAttr('disabled');\n }\n set disabled(value: boolean) {\n this.toggleAttr('disabled', Boolean(value));\n }\n\n /** getter/setter `value` → espelho do atributo `value` (compat com v-model / [(value)]). */\n get value(): string { return this.getAttr('value'); }\n set value(v: string) {
|
|
1
|
+
{"version":3,"file":"switch.js","sources":["../../../src/components/switch/switch.ts"],"sourcesContent":["import { FxFormElement } from '../../core/form-element';\nimport { css } from '../../core/css';\nimport { defineElement } from '../../core/define';\n\n/**\n * <fx-switch> — Interruptor ligado/desligado (role=\"switch\").\n *\n * Form-Associated Custom Element: dentro de um <form> entra no FormData\n * (via atributo `name`) com `value` (ou 'on') quando ligado — desligado\n * não envia nada, igual ao checkbox. Recebe reset/disable do form.\n *\n * O texto do slot (light DOM) é o rótulo clicável.\n * Atributos: checked, disabled, value, name, size (sm|md|lg).\n * Eventos: `change` e `checkedChange` (composed, detail: { checked, value }) —\n * `checkedChange` é o two-way binding do Angular [(checked)].\n *\n * Vue: use `:checked=\"estado\"` + `@change` (o `v-model` padrão de elemento\n * customizado usa `value` + `input`, não `checked`).\n */\nexport class FxSwitch extends FxFormElement {\n static override styles = css`\n :host {\n display: inline-flex;\n vertical-align: middle;\n font-family: var(--fx-font-family);\n font-size: var(--fx-font-size);\n }\n .switch {\n display: inline-flex;\n align-items: center;\n gap: var(--fx-space-sm);\n cursor: pointer;\n user-select: none;\n background: none;\n border: none;\n padding: 0;\n color: var(--fx-text-default);\n font: inherit;\n }\n .track {\n position: relative;\n width: 40px;\n height: 22px;\n border-radius: var(--fx-radius-full);\n background: var(--fx-border-default);\n flex-shrink: 0;\n transition: background-color var(--fx-motion-duration-normal) var(--fx-motion-easing);\n }\n .thumb {\n position: absolute;\n top: 3px;\n left: 3px;\n width: 16px;\n height: 16px;\n border-radius: var(--fx-radius-full);\n background: #fff;\n box-shadow: var(--fx-shadow-sm);\n transition: transform var(--fx-motion-duration-normal) var(--fx-motion-easing);\n }\n :host([checked]) .track { background: var(--fx-color-primary); }\n :host([checked]) .thumb { transform: translateX(18px); }\n .switch:focus-visible .track {\n outline: none;\n box-shadow: var(--fx-effect-focus-ring, none);\n }\n .label { display: inline-flex; align-items: center; }\n :host([disabled]) .switch { opacity: 0.55; cursor: not-allowed; pointer-events: none; }\n /* Escala: sm 32×18 · md 40×22 (padrão) · lg 48×26 */\n :host([size='sm']) .track { width: 32px; height: 18px; }\n :host([size='sm']) .thumb { top: 2px; left: 2px; width: 14px; height: 14px; }\n :host([size='sm'][checked]) .thumb { transform: translateX(14px); }\n :host([size='lg']) .track { width: 48px; height: 26px; }\n :host([size='lg']) .thumb { top: 4px; left: 4px; width: 18px; height: 18px; }\n :host([size='lg'][checked]) .thumb { transform: translateX(22px); }\n `;\n\n static override get observedAttributes(): string[] {\n return ['checked', 'disabled', 'size'];\n }\n\n /** Tamanho da trilha. Padrão: `'md'`. */\n get size(): string {\n const s = this.getAttr('size', 'md');\n return s === 'sm' || s === 'lg' ? s : 'md';\n }\n set size(value: string) {\n this.setAttribute('size', value);\n }\n\n get checked(): boolean {\n return this.hasAttr('checked');\n }\n set checked(value: boolean) {\n this.toggleAttr('checked', Boolean(value));\n }\n\n get disabled(): boolean {\n return this.hasAttr('disabled');\n }\n set disabled(value: boolean) {\n this.toggleAttr('disabled', Boolean(value));\n }\n\n /** getter/setter `value` → espelho do atributo `value` (compat com v-model / [(value)]). */\n get value(): string { return this.getAttr('value'); }\n set value(v: string | null | undefined) {\n this.setAttribute('value', v == null ? '' : String(v));\n // Se o switch já está ligado, o FormData precisa refletir o novo valor.\n this.updateFormValue();\n }\n\n /** No FormData: `value` (ou 'on') quando ligado; null (não envia) quando não. */\n protected override getFormValue(): string | FormData | null {\n return this.checked ? (this.getAttr('value') || 'on') : null;\n }\n\n protected override render(): void {\n this.setTemplate(`\n <button class=\"switch\" part=\"switch\" type=\"button\" role=\"switch\"\n aria-checked=\"${this.checked}\" ${this.hasAttr('disabled') ? 'disabled' : ''}>\n <span class=\"track\" part=\"track\"><span class=\"thumb\" part=\"thumb\"></span></span>\n <span class=\"label\" part=\"label\"><slot></slot></span>\n </button>\n `);\n\n const btn = this.root.querySelector<HTMLButtonElement>('.switch');\n if (!btn) return;\n btn.addEventListener('click', () => {\n if (this.hasAttr('disabled')) return;\n this.checked = !this.checked;\n btn.setAttribute('aria-checked', String(this.checked));\n this.dispatchEvent(\n new CustomEvent('change', {\n bubbles: true,\n composed: true,\n detail: { checked: this.checked },\n }),\n );\n // Two-way binding do Angular: [(checked)] = [checked] + (checkedChange).\n this.dispatchEvent(\n new CustomEvent('checkedChange', {\n bubbles: true,\n composed: true,\n detail: { checked: this.checked, value: this.getAttr('value') },\n }),\n );\n });\n\n // Publica name/value no form (ElementInternals) a cada render.\n this.updateFormValue();\n }\n\n /** Estado marcado inicial (para form.reset() restaurar). */\n private _initialChecked = false;\n private _initialCheckedCaptured = false;\n\n protected override connectedCallback(): void {\n if (!this._initialCheckedCaptured) {\n this._initialCheckedCaptured = true;\n this._initialChecked = this.checked;\n }\n super.connectedCallback();\n }\n\n /** form.reset(): restaura o estado inicial (desligado por padrão). */\n override formResetCallback(): void {\n this.checked = this._initialChecked;\n const btn = this.root.querySelector<HTMLButtonElement>('.switch');\n if (btn) btn.setAttribute('aria-checked', String(this.checked));\n this.updateFormValue();\n }\n}\n\nexport function defineFxSwitch(): typeof FxSwitch {\n return defineElement('fx-switch', FxSwitch);\n}\n"],"names":[],"mappings":";;;AAmBO,MAAM,YAAN,MAAM,kBAAiB,cAAc;AAAA,EAArC,cAAA;AAAA,UAAA,GAAA,SAAA;AAsIL,SAAQ,kBAAkB;AAC1B,SAAQ,0BAA0B;AAAA,EAAA;AAAA,EA9ElC,WAAoB,qBA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
|
private _columnObserver?;
|
|
63
|
+
/** Inputs da toolbar slotted já receberam listener (não recria a cada render). */
|
|
64
|
+
private _boundToolbarInputs;
|
|
63
65
|
get data(): Record<string, unknown>[];
|
|
64
66
|
set data(value: Record<string, unknown>[]);
|
|
65
67
|
get total(): number;
|
|
@@ -67,6 +69,22 @@ export declare class FxTable extends FxElement {
|
|
|
67
69
|
get rowsPerPage(): number;
|
|
68
70
|
set rowsPerPage(value: number);
|
|
69
71
|
get lazy(): boolean;
|
|
72
|
+
set lazy(value: boolean);
|
|
73
|
+
get pagination(): boolean;
|
|
74
|
+
set pagination(value: boolean);
|
|
75
|
+
get striped(): boolean;
|
|
76
|
+
set striped(value: boolean);
|
|
77
|
+
get hover(): boolean;
|
|
78
|
+
set hover(value: boolean);
|
|
79
|
+
get loading(): boolean;
|
|
80
|
+
set loading(value: boolean);
|
|
81
|
+
/**
|
|
82
|
+
* Vue não cameliza atributos de elementos customizados:
|
|
83
|
+
* `:no-borders-x="false"` procura a propriedade LITERAL
|
|
84
|
+
* `'no-borders-x'` — o accessor literal evita o contorno `.attr`.
|
|
85
|
+
*/
|
|
86
|
+
get 'no-borders-x'(): boolean;
|
|
87
|
+
set 'no-borders-x'(value: boolean);
|
|
70
88
|
private get columns();
|
|
71
89
|
/**
|
|
72
90
|
* Resolve o template de célula de uma `<fx-column>`, em ordem de prioridade:
|
|
@@ -123,6 +141,15 @@ export declare class FxTable extends FxElement {
|
|
|
123
141
|
* <tbody>): os <tr> são novos, então precisam ser rebound.
|
|
124
142
|
*/
|
|
125
143
|
private _bindRowClicks;
|
|
144
|
+
/** Liga (uma vez) os inputs de busca de um <fx-toolbar> slotted. */
|
|
145
|
+
private _bindSlottedToolbarSearch;
|
|
146
|
+
/**
|
|
147
|
+
* Liga um input da toolbar à busca global.
|
|
148
|
+
* `persistent` = input slotted (não é recriado pelo render): o foco volta
|
|
149
|
+
* no próprio nó. Inputs clonados são substituídos, então o foco é
|
|
150
|
+
* restaurado no clone novo do shadow.
|
|
151
|
+
*/
|
|
152
|
+
private _bindSearchInput;
|
|
126
153
|
private _restoreToolbarSearch;
|
|
127
154
|
}
|
|
128
155
|
export declare function defineFxTable(): typeof FxTable;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../src/components/table/table.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAQ5C,OAAO,WAAW,CAAC;AAEnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,qBAAa,OAAQ,SAAQ,SAAS;IACrC,OAAgB,MAAM,
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../src/components/table/table.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAQ5C,OAAO,WAAW,CAAC;AAEnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,qBAAa,OAAQ,SAAQ,SAAS;IACrC,OAAgB,MAAM,SAiTpB;IAEF,WAAoB,kBAAkB,IAAI,MAAM,EAAE,CAoBjD;IAED,OAAO,CAAC,KAAK,CAAiC;IAC9C,OAAO,CAAC,MAAM,CAAC,CAAS;IACxB,OAAO,CAAC,IAAI,CAAK;IACjB,OAAO,CAAC,SAAS,CAAM;IACvB,OAAO,CAAC,OAAO,CAAa;IAC5B,OAAO,CAAC,OAAO,CAA8B;IAC7C,OAAO,CAAC,YAAY,CAAM;IAC1B,OAAO,CAAC,eAAe,CAAC,CAAmB;IAC3C,kFAAkF;IAClF,OAAO,CAAC,mBAAmB,CAAmC;IAE9D,IAAI,IAAI,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAEpC;IACD,IAAI,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAGxC;IAED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AAO,CAAC,gBAAgB;IAgBxB,OAAO,CAAC,qBAAqB;CAiB7B;AAED,wBAAgB,aAAa,IAAI,OAAO,OAAO,CAE9C"}
|
|
@@ -16,6 +16,7 @@ const _FxTable = class _FxTable extends FxElement {
|
|
|
16
16
|
this.sortDir = 1;
|
|
17
17
|
this.filters = {};
|
|
18
18
|
this.globalSearch = "";
|
|
19
|
+
this._boundToolbarInputs = /* @__PURE__ */ new WeakSet();
|
|
19
20
|
this._shellKey = "";
|
|
20
21
|
}
|
|
21
22
|
static get observedAttributes() {
|
|
@@ -63,6 +64,44 @@ const _FxTable = class _FxTable extends FxElement {
|
|
|
63
64
|
get lazy() {
|
|
64
65
|
return this.hasAttr("lazy");
|
|
65
66
|
}
|
|
67
|
+
set lazy(value) {
|
|
68
|
+
this.toggleAttr("lazy", Boolean(value));
|
|
69
|
+
}
|
|
70
|
+
get pagination() {
|
|
71
|
+
return this.hasAttr("pagination");
|
|
72
|
+
}
|
|
73
|
+
set pagination(value) {
|
|
74
|
+
this.toggleAttr("pagination", Boolean(value));
|
|
75
|
+
}
|
|
76
|
+
get striped() {
|
|
77
|
+
return this.hasAttr("striped");
|
|
78
|
+
}
|
|
79
|
+
set striped(value) {
|
|
80
|
+
this.toggleAttr("striped", Boolean(value));
|
|
81
|
+
}
|
|
82
|
+
get hover() {
|
|
83
|
+
return this.hasAttr("hover");
|
|
84
|
+
}
|
|
85
|
+
set hover(value) {
|
|
86
|
+
this.toggleAttr("hover", Boolean(value));
|
|
87
|
+
}
|
|
88
|
+
get loading() {
|
|
89
|
+
return this.hasAttr("loading");
|
|
90
|
+
}
|
|
91
|
+
set loading(value) {
|
|
92
|
+
this.toggleAttr("loading", Boolean(value));
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Vue não cameliza atributos de elementos customizados:
|
|
96
|
+
* `:no-borders-x="false"` procura a propriedade LITERAL
|
|
97
|
+
* `'no-borders-x'` — o accessor literal evita o contorno `.attr`.
|
|
98
|
+
*/
|
|
99
|
+
get "no-borders-x"() {
|
|
100
|
+
return this.hasAttr("no-borders-x");
|
|
101
|
+
}
|
|
102
|
+
set "no-borders-x"(value) {
|
|
103
|
+
this.toggleAttr("no-borders-x", Boolean(value));
|
|
104
|
+
}
|
|
66
105
|
get columns() {
|
|
67
106
|
return [...this.querySelectorAll("fx-column")].map((c) => {
|
|
68
107
|
const tpl = this._resolveCellTemplate(c);
|
|
@@ -146,7 +185,14 @@ const _FxTable = class _FxTable extends FxElement {
|
|
|
146
185
|
loadFenixIconsFont();
|
|
147
186
|
super.connectedCallback();
|
|
148
187
|
this._columnObserver = new MutationObserver(() => this.render());
|
|
149
|
-
this._columnObserver.observe(this, {
|
|
188
|
+
this._columnObserver.observe(this, {
|
|
189
|
+
childList: true,
|
|
190
|
+
subtree: true,
|
|
191
|
+
// Colunas com header/field/align/sortable/filterable alterados
|
|
192
|
+
// em runtime também precisam re-renderizar.
|
|
193
|
+
attributes: true,
|
|
194
|
+
attributeFilter: ["header", "field", "align", "sortable", "filterable", "template"]
|
|
195
|
+
});
|
|
150
196
|
}
|
|
151
197
|
disconnectedCallback() {
|
|
152
198
|
this._columnObserver?.disconnect();
|
|
@@ -228,7 +274,14 @@ const _FxTable = class _FxTable extends FxElement {
|
|
|
228
274
|
const pages = Math.max(1, Math.ceil(total / this.rowsPerPage));
|
|
229
275
|
if (this.page >= pages) this.page = pages - 1;
|
|
230
276
|
const toolbar = this.toolbarTemplate;
|
|
231
|
-
const
|
|
277
|
+
const toolbarSlotted = toolbar?.localName === "fx-toolbar";
|
|
278
|
+
const toolbarHasContent = Boolean(
|
|
279
|
+
toolbar && (toolbarSlotted ? toolbar.children.length > 0 || (toolbar.textContent ?? "").trim() !== "" : toolbar.innerHTML.trim() !== "")
|
|
280
|
+
);
|
|
281
|
+
if (toolbarSlotted && toolbarHasContent) {
|
|
282
|
+
toolbar.setAttribute("slot", "fx-toolbar");
|
|
283
|
+
}
|
|
284
|
+
const toolbarHtml = toolbarHasContent ? `<div class="toolbar" part="toolbar">${toolbarSlotted ? '<slot name="fx-toolbar"></slot>' : toolbar.innerHTML}</div>` : "";
|
|
232
285
|
const headHtml = cols.map((c) => {
|
|
233
286
|
const isSorted = this.sortField === c.field;
|
|
234
287
|
const ind = isSorted ? this.sortDir === 1 ? "▲" : "▼" : c.sortable ? "⇅" : "";
|
|
@@ -251,7 +304,7 @@ const _FxTable = class _FxTable extends FxElement {
|
|
|
251
304
|
<button type="button" class="pg-btn" part="next" aria-label="Próxima página" data-pg="next" ${this.page >= pages - 1 ? "disabled" : ""}>${fenixIconHtml("navigate_next")}</button>
|
|
252
305
|
<button type="button" class="pg-btn" part="last" aria-label="Última página" data-pg="last" ${this.page >= pages - 1 ? "disabled" : ""}>${fenixIconHtml("last_page")}</button>
|
|
253
306
|
<label class="info">${esc("Por página:")}
|
|
254
|
-
<fx-select class="rows-sel" size="sm" value="${this.rowsPerPage}" aria-label="Itens por página">${this.getAttr(
|
|
307
|
+
<fx-select class="rows-sel" size="sm" placement="top" value="${this.rowsPerPage}" aria-label="Itens por página">${this.getAttr(
|
|
255
308
|
"rows-options",
|
|
256
309
|
"5,10,20,50"
|
|
257
310
|
).split(",").map((n) => n.trim()).map((n) => `<option value="${esc(n)}">${esc(n)}</option>`).join("")}</fx-select>
|
|
@@ -272,13 +325,15 @@ const _FxTable = class _FxTable extends FxElement {
|
|
|
272
325
|
if (tbody) {
|
|
273
326
|
tbody.innerHTML = bodyHtml;
|
|
274
327
|
this._bindRowClicks(rows);
|
|
328
|
+
this._bindSlottedToolbarSearch(toolbar);
|
|
329
|
+
this._restoreToolbarSearch();
|
|
275
330
|
return;
|
|
276
331
|
}
|
|
277
332
|
}
|
|
278
333
|
this._shellKey = shellKey;
|
|
279
334
|
this.setTemplate(`
|
|
280
335
|
${toolbarHtml}
|
|
281
|
-
<div class="frame${
|
|
336
|
+
<div class="frame${toolbarHasContent ? " has-toolbar" : ""}" part="frame">
|
|
282
337
|
<div class="table-wrap">
|
|
283
338
|
<div class="scroll">
|
|
284
339
|
<table part="table">
|
|
@@ -339,21 +394,10 @@ const _FxTable = class _FxTable extends FxElement {
|
|
|
339
394
|
});
|
|
340
395
|
inp.addEventListener("click", (e) => e.stopPropagation());
|
|
341
396
|
});
|
|
342
|
-
this.root.querySelectorAll("[data-search-fields]").forEach((inp) =>
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
const pos = inp.selectionStart;
|
|
347
|
-
this.render();
|
|
348
|
-
const again = this.root.querySelector(
|
|
349
|
-
"[data-search-fields]"
|
|
350
|
-
);
|
|
351
|
-
if (again) {
|
|
352
|
-
again.focus();
|
|
353
|
-
again.setSelectionRange(pos, pos);
|
|
354
|
-
}
|
|
355
|
-
});
|
|
356
|
-
});
|
|
397
|
+
this.root.querySelectorAll("[data-search-fields]").forEach((inp) => this._bindSearchInput(inp, false));
|
|
398
|
+
if (toolbarSlotted && toolbar) {
|
|
399
|
+
this._bindSlottedToolbarSearch(toolbar);
|
|
400
|
+
}
|
|
357
401
|
this.root.querySelectorAll(".pg-btn").forEach((btn) => {
|
|
358
402
|
btn.addEventListener("click", () => {
|
|
359
403
|
const pg = btn.dataset.pg;
|
|
@@ -406,11 +450,47 @@ const _FxTable = class _FxTable extends FxElement {
|
|
|
406
450
|
});
|
|
407
451
|
});
|
|
408
452
|
}
|
|
453
|
+
/** Liga (uma vez) os inputs de busca de um <fx-toolbar> slotted. */
|
|
454
|
+
_bindSlottedToolbarSearch(toolbar) {
|
|
455
|
+
if (!toolbar || toolbar.localName !== "fx-toolbar") return;
|
|
456
|
+
toolbar.querySelectorAll("[data-search-fields]").forEach((inp) => {
|
|
457
|
+
if (this._boundToolbarInputs.has(inp)) return;
|
|
458
|
+
this._boundToolbarInputs.add(inp);
|
|
459
|
+
this._bindSearchInput(inp, true);
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
/**
|
|
463
|
+
* Liga um input da toolbar à busca global.
|
|
464
|
+
* `persistent` = input slotted (não é recriado pelo render): o foco volta
|
|
465
|
+
* no próprio nó. Inputs clonados são substituídos, então o foco é
|
|
466
|
+
* restaurado no clone novo do shadow.
|
|
467
|
+
*/
|
|
468
|
+
_bindSearchInput(inp, persistent) {
|
|
469
|
+
inp.addEventListener("input", () => {
|
|
470
|
+
this.globalSearch = inp.value;
|
|
471
|
+
this.page = 0;
|
|
472
|
+
const pos = inp.selectionStart;
|
|
473
|
+
this.render();
|
|
474
|
+
const again = persistent && inp.isConnected ? inp : this.root.querySelector("[data-search-fields]");
|
|
475
|
+
if (again) {
|
|
476
|
+
again.focus();
|
|
477
|
+
again.setSelectionRange(pos, pos);
|
|
478
|
+
}
|
|
479
|
+
});
|
|
480
|
+
}
|
|
409
481
|
_restoreToolbarSearch() {
|
|
410
|
-
const
|
|
482
|
+
const shadow = this.root.querySelector(
|
|
411
483
|
"[data-search-fields]"
|
|
412
484
|
);
|
|
413
|
-
if (
|
|
485
|
+
if (shadow && this.globalSearch) shadow.value = this.globalSearch;
|
|
486
|
+
const toolbar = this.toolbarTemplate;
|
|
487
|
+
if (toolbar?.localName === "fx-toolbar") {
|
|
488
|
+
toolbar.querySelectorAll("[data-search-fields]").forEach((input) => {
|
|
489
|
+
if (this.globalSearch && input.value !== this.globalSearch) {
|
|
490
|
+
input.value = this.globalSearch;
|
|
491
|
+
}
|
|
492
|
+
});
|
|
493
|
+
}
|
|
414
494
|
}
|
|
415
495
|
};
|
|
416
496
|
_FxTable.styles = css`
|
|
@@ -488,6 +568,13 @@ _FxTable.styles = css`
|
|
|
488
568
|
border-bottom: 2px solid var(--fx-border-default);
|
|
489
569
|
white-space: nowrap;
|
|
490
570
|
user-select: none;
|
|
571
|
+
/* Cor/peso do cabeçalho por token de TABELA. Sem isso o th herda
|
|
572
|
+
--fx-text-default do host e o peso vem do UA (bold). */
|
|
573
|
+
color: var(
|
|
574
|
+
--fx-table-header-text,
|
|
575
|
+
var(--fx-table-text, var(--fx-text-default))
|
|
576
|
+
);
|
|
577
|
+
font-weight: var(--fx-table-header-weight, bold);
|
|
491
578
|
}
|
|
492
579
|
th.sortable {
|
|
493
580
|
cursor: pointer;
|
|
@@ -532,6 +619,12 @@ _FxTable.styles = css`
|
|
|
532
619
|
td {
|
|
533
620
|
padding: var(--fx-space-sm) var(--fx-space-md);
|
|
534
621
|
border-bottom: 1px solid var(--fx-border-default);
|
|
622
|
+
/* Texto do corpo: token próprio para não depender de
|
|
623
|
+
--fx-text-default (que afeta TODOS os textos do app) e para
|
|
624
|
+
não herdar o font-weight do body da página — era isso que
|
|
625
|
+
fazia a célula parecer mais clara que o cabeçalho. */
|
|
626
|
+
color: var(--fx-table-text, var(--fx-text-default));
|
|
627
|
+
font-weight: var(--fx-table-text-weight, inherit);
|
|
535
628
|
}
|
|
536
629
|
tbody tr {
|
|
537
630
|
cursor: pointer;
|
|
@@ -666,6 +759,11 @@ _FxTable.styles = css`
|
|
|
666
759
|
.toolbar:empty {
|
|
667
760
|
display: none;
|
|
668
761
|
}
|
|
762
|
+
/* <fx-toolbar> é apenas um invólucro no light DOM: o slot projeta
|
|
763
|
+
seus filhos (com listeners do Vue preservados) direto no flex. */
|
|
764
|
+
::slotted(fx-toolbar) {
|
|
765
|
+
display: contents;
|
|
766
|
+
}
|
|
669
767
|
.loading-overlay {
|
|
670
768
|
position: absolute;
|
|
671
769
|
inset: 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.js","sources":["../../../src/components/table/table.ts"],"sourcesContent":["import { FxElement } from '../../core/base';\nimport { css } from '../../core/css';\nimport { defineElement } from '../../core/define';\nimport { pageRange } from '../../core/page-range';\nimport { esc } from \"../../core/sanitize\";\nimport { FENIX_ICON_BASE_CSS, fenixIconHtml } from '../../icons/base-css';\nimport { loadFenixIconsFont } from '../../icons/font';\nimport { renderCell } from \"./expr\";\nimport \"../select\";\n\n/**\n * <fx-table> — Tabela de dados estilo DataTable (dados + colunas configuráveis,\n * ordenação, filtros por coluna, paginação personalizável, busca global na toolbar\n * e modo lazy para busca no servidor).\n *\n * Colunas (light DOM):\n * <fx-column field=\"nome\" header=\"Nome\" sortable filterable align=\"left\">\n * opcional: <fx-cell>R$ {{value}}</fx-cell> para render customizado\n * ou conteúdo direto (HTML + {{ }}) como template alternativo\n * </fx-column>\n *\n * IMPORTANTE (frameworks): use <fx-cell>, NÃO <template>. A tag nativa\n * <template> é reservada — o Vue 3 a transforma em bloco do compilador e o\n * React gerencia os filhos, então o innerHTML chega vazio. <fx-cell> é uma\n * tag própria, sem significado especial para nenhum framework. A forma\n * antiga com <template> continua funcionando (compatibilidade) e há ainda\n * a opção `template=\"#id\"` apontando para um <template> externo.\n *\n * ⚠️ REGRA DO v-pre (Vue) — o conteúdo do <fx-cell> é TEXTO CRU:\n * {{ }} é avaliado pelo motor de expressões do <fx-table> (./expr.ts) e\n * NÃO pelo Vue. Sem `v-pre`, o compilador do Vue consome a interpolação\n * antes: emite `_toDisplayString(_ctx.value | _ctx.number)`, o conteúdo\n * chega sem as chaves no innerHTML e o vue-tsc acusa `value`/`number`\n * inexistentes no escopo. → SEMPRE use <fx-cell v-pre> no Vue.\n *\n * Cada framework tem a sua neutralização (todas verificadas por compilador):\n * - Vue 3 / Nuxt .... v-pre <fx-cell v-pre>{{ value }}</fx-cell>\n * - React / JSX ..... string JS <fx-cell>{'{{ value }}'}</fx-cell>\n * (o `{{ }}` solto é ERRO de sintaxe no parser JSX)\n * - Angular ......... ngNonBindable <fx-cell ngNonBindable>…</fx-cell>\n * - Svelte .......... string JS ou entidades HTML\n * {'{{ value }}'} ou {{ value }}\n * - HTML/CDN/JSF/JSP nada <fx-cell>{{ value }}</fx-cell>\n *\n * Toolbar (opcional):\n * <fx-toolbar>\n * <input data-search-fields=\"nome,cargo\" placeholder=\"Buscar…\">\n * <button>Nova ação</button>\n * </fx-toolbar>\n * (legado ainda aceito: <template slot=\"toolbar\">…</template>)\n *\n * Dados: propriedade `data` (array de objetos) ou atributo `data` (JSON).\n *\n * Atributos: pagination, rows, rows-options, pagination-position (left|center|right),\n * striped, hover, empty-message, lazy, total, loading, loading-message,\n * sort-field, sort-order, rounded (none|sm|md|lg, padrão md; `radius` é alias),\n * no-borders-x (remove apenas as bordas laterais, mantendo topo e base).\n * Eventos: page-change, sort-change, row-click, filter-change (todos composed).\n */\nexport class FxTable extends FxElement {\n\tstatic override styles = css`\n\t\t${FENIX_ICON_BASE_CSS}\n\t\t:host {\n\t\t\tdisplay: block;\n\t\t\tfont-family: var(--fx-font-family);\n\t\t\tfont-size: var(--fx-font-size);\n\t\t\tcolor: var(--fx-text-default);\n\t\t\tbackground: var(--fx-surface-background);\n\t\t\t/* Raio da moldura (tabela + paginação). O atributo \"rounded\"\n\t\t\t sobrescreve este valor e o consumidor também pode sobrescrever\n\t\t\t por CSS: fx-table { --fx-table-radius: 20px; }. */\n\t\t\t--fx-table-radius: var(--fx-radius-md);\n\t\t}\n\t\t/* Arredondamento das bordas — \"none\" deixa tudo reto, como nos demais\n\t\t tokens de radius do design system. \"rounded\" é o nome atual; \"radius\"\n\t\t segue aceito como alias para ficar consistente com o <fx-card>. */\n\t\t:host([rounded=\"none\"]),\n\t\t:host([radius=\"none\"]) {\n\t\t\t--fx-table-radius: var(--fx-radius-none, 0);\n\t\t}\n\t\t:host([rounded=\"sm\"]),\n\t\t:host([radius=\"sm\"]) {\n\t\t\t--fx-table-radius: var(--fx-radius-sm);\n\t\t}\n\t\t:host([rounded=\"md\"]),\n\t\t:host([radius=\"md\"]) {\n\t\t\t--fx-table-radius: var(--fx-radius-md);\n\t\t}\n\t\t:host([rounded=\"lg\"]),\n\t\t:host([radius=\"lg\"]) {\n\t\t\t--fx-table-radius: var(--fx-radius-lg);\n\t\t}\n\t\t/* Moldura: uma única borda envolvendo a tabela E a paginação, para que\n\t\t o pager não fique \"solto\" fora do contorno da tabela. */\n\t\t.frame {\n\t\t\tborder: 1px solid var(--fx-border-default);\n\t\t\tborder-radius: var(--fx-table-radius);\n\t\t\tbackground: var(--fx-surface-background);\n\t\t}\n\t\t/* Com toolbar no topo, quem desenha a borda superior é a própria\n\t\t toolbar — a moldura desenha apenas o contorno restante. */\n\t\t.frame.has-toolbar {\n\t\t\tborder-top: none;\n\t\t}\n\t\t/* \"no-borders-x\": mantém somente as bordas de topo e de base\n\t\t (tabela encaixada em um layout que já desenha as laterais). */\n\t\t:host([no-borders-x]) .frame,\n\t\t:host([no-borders-x]) .toolbar {\n\t\t\tborder-left: none;\n\t\t\tborder-right: none;\n\t\t}\n\t\t.table-wrap {\n\t\t\tposition: relative;\n\t\t}\n\t\t.scroll {\n\t\t\toverflow-x: auto;\n\t\t\t/* O topo acompanha o raio da moldura; a base fica reta porque o\n\t\t\t rodapé (.pager) é quem a desenha. */\n\t\t\tborder-radius: var(--fx-table-radius) var(--fx-table-radius) 0 0;\n\t\t}\n\t\t/* Sem paginação não existe rodapé: a moldura fecha embaixo. */\n\t\t:host(:not([pagination])) .scroll {\n\t\t\tborder-radius: var(--fx-table-radius);\n\t\t}\n\t\ttable {\n\t\t\twidth: 100%;\n\t\t\tborder-collapse: collapse;\n\t\t}\n\t\tth {\n\t\t\ttext-align: left;\n\t\t\tpadding: var(--fx-space-sm) var(--fx-space-md);\n\t\t\tbackground: var(--fx-surface-surface);\n\t\t\tborder-bottom: 2px solid var(--fx-border-default);\n\t\t\twhite-space: nowrap;\n\t\t\tuser-select: none;\n\t\t}\n\t\tth.sortable {\n\t\t\tcursor: pointer;\n\t\t}\n\t\tth.sortable:hover {\n\t\t\tcolor: var(--fx-color-primary);\n\t\t}\n\t\t.sort-ind {\n\t\t\tfont-size: calc(var(--fx-font-size) - 4px);\n\t\t\tmargin-left: var(--fx-space-3xs, 2px);\n\t\t\topacity: 0.45;\n\t\t\ttransition: opacity var(--fx-motion-duration-fast)\n\t\t\t\tvar(--fx-motion-easing);\n\t\t}\n\t\tth.sortable:hover .sort-ind {\n\t\t\topacity: 0.85;\n\t\t}\n\t\t.sort-ind.active {\n\t\t\topacity: 1;\n\t\t\tcolor: var(--fx-color-primary);\n\t\t}\n\t\t.filter-row th {\n\t\t\tpadding: var(--fx-space-3xs, 4px) var(--fx-space-md) var(--fx-space-sm);\n\t\t\tborder-bottom-width: 1px;\n\t\t}\n\t\t.filter {\n\t\t\twidth: 100%;\n\t\t\tbox-sizing: border-box;\n\t\t\tfont: inherit;\n\t\t\tfont-size: calc(var(--fx-font-size) - 2px);\n\t\t\tcolor: var(--fx-text-default);\n\t\t\tbackground: var(--fx-surface-background);\n\t\t\tborder: 1px solid var(--fx-border-default);\n\t\t\tborder-radius: var(--fx-radius-sm);\n\t\t\tpadding: var(--fx-space-3xs, 4px) var(--fx-space-xs);\n\t\t\toutline: none;\n\t\t}\n\t\t.filter:focus {\n\t\t\tborder-color: var(--fx-color-primary);\n\t\t\tbox-shadow: var(--fx-effect-focus-ring, none);\n\t\t}\n\t\ttd {\n\t\t\tpadding: var(--fx-space-sm) var(--fx-space-md);\n\t\t\tborder-bottom: 1px solid var(--fx-border-default);\n\t\t}\n\t\ttbody tr {\n\t\t\tcursor: pointer;\n\t\t\ttransition: background-color var(--fx-motion-duration-fast)\n\t\t\t\tvar(--fx-motion-easing);\n\t\t}\n\t\t/* Listrado: alterna a superfície (cinza). Antes usava\n\t\t --fx-surface-background, que é a MESMA cor do fundo do :host e\n\t\t portanto pintava branco sobre branco (listrado invisível). */\n\t\t:host([striped]) tbody tr:nth-child(even) {\n\t\t\tbackground: var(--fx-surface-surface, #f8fafc);\n\t\t}\n\t\t/* O hover é opt-in via atributo (o clique na linha continua sempre ativo). */\n\t\t:host([hover]) tbody tr:hover {\n\t\t\tbackground: color-mix(\n\t\t\t\tin srgb,\n\t\t\t\tvar(--fx-color-primary) 8%,\n\t\t\t\ttransparent\n\t\t\t);\n\t\t}\n\t\t.empty {\n\t\t\ttext-align: center;\n\t\t\tpadding: var(--fx-space-xl);\n\t\t\tcolor: var(--fx-text-muted);\n\t\t}\n\t\t.pager {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: var(--fx-space-sm);\n\t\t\tflex-wrap: wrap;\n\t\t\t/* O rodapé é parte da moldura: borda só no topo (separando da\n\t\t\t tabela) e o mesmo padding horizontal das células. Antes ele\n\t\t\t ficava fora do contorno, sem borda e sem respiro lateral. */\n\t\t\tpadding: var(--fx-space-sm) var(--fx-space-md);\n\t\t\tborder-top: 1px solid var(--fx-border-default);\n\t\t\tborder-radius: 0 0 var(--fx-table-radius) var(--fx-table-radius);\n\t\t\tbackground: var(--fx-surface-background);\n\t\t}\n\t\t:host([pagination-position=\"center\"]) .pager {\n\t\t\tjustify-content: center;\n\t\t}\n\t\t:host([pagination-position=\"right\"]) .pager {\n\t\t\tjustify-content: flex-end;\n\t\t}\n\t\t.pager .info {\n\t\t\tcolor: var(--fx-text-muted);\n\t\t\tfont-size: calc(var(--fx-font-size) - 2px);\n\t\t}\n\t\t.pg-btn {\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tmin-width: var(--fx-size-sm);\n\t\t\theight: var(--fx-size-sm);\n\t\t\tfont: inherit;\n\t\t\tfont-size: calc(var(--fx-font-size) - 2px);\n\t\t\tcolor: var(--fx-text-default);\n\t\t\tbackground: var(--fx-surface-background);\n\t\t\tborder: 1px solid var(--fx-border-default);\n\t\t\tborder-radius: var(--fx-radius-sm);\n\t\t\tpadding: var(--fx-space-3xs, 4px) var(--fx-space-sm);\n\t\t\tcursor: pointer;\n\t\t\ttransition: border-color var(--fx-motion-duration-fast)\n\t\t\t\tvar(--fx-motion-easing);\n\t\t}\n\t\t/* O glifo precisa de 1px a mais que o dígito: a altura de traço do ícone é\n\t\t maior que a do número, então igualar os dois font-size deixa a seta\n\t\t visivelmente maior que o texto. */\n\t\t.pg-btn .fx-icon {\n\t\t\tfont-size: calc(var(--fx-font-size) - 1px);\n\t\t}\n\t\t.pg-btn:hover:not(:disabled):not([aria-current=\"page\"]) {\n\t\t\tborder-color: var(--fx-color-primary);\n\t\t\tcolor: var(--fx-color-primary);\n\t\t}\n\t\t.pg-btn:disabled {\n\t\t\topacity: 0.5;\n\t\t\tcursor: not-allowed;\n\t\t}\n\t\t.pg-btn[aria-current=\"page\"] {\n\t\t\tbackground: var(--fx-color-primary);\n\t\t\tborder-color: var(--fx-color-primary);\n\t\t\tcolor: #fff;\n\t\t\tfont-weight: var(--fx-font-weight);\n\t\t}\n\t\t/* Elipse da janela de páginas (1 … 499 [500] 501 … 1000): ocupa o\n\t\t mesmo espaço de um botão para o rodapé não \"pular\" ao navegar,\n\t\t mas não é clicável. */\n\t\t.pager .ellipsis {\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tmin-width: var(--fx-size-sm);\n\t\t\theight: var(--fx-size-sm);\n\t\t\tcolor: var(--fx-text-muted);\n\t\t\tfont-size: calc(var(--fx-font-size) - 2px);\n\t\t\tuser-select: none;\n\t\t}\n\t\t/* O seletor \"Por página\" só mostra números, então não pode herdar a\n\t\t largura padrão do <fx-select> (200px / 180px em size=\"sm\"), que\n\t\t deixava o rodapé da paginação desproporcional. O limite tem que ser\n\t\t no HOST — apertar só ::part(trigger) não funciona, porque o\n\t\t trigger é width:100% e continua herdando o min-width do host.\n\t\t O painel (dropdown) continua largo (220px) em select.ts. */\n\t\tfx-select.rows-sel {\n\t\t\tvertical-align: middle;\n\t\t\t/* Não deixa o flex do .pager esticar nem esmagar o controle. */\n\t\t\tflex: none;\n\t\t\twidth: auto;\n\t\t\t--fx-select-min-width: 56px;\n\t\t\t--fx-select-min-width-sm: 56px;\n\t\t}\n\t\tfx-select.rows-sel::part(trigger) {\n\t\t\tmin-width: 0;\n\t\t\tmin-height: var(--fx-size-sm);\n\t\t\t/* Padding curto: sobra espaço para o número + caret. */\n\t\t\tpadding: 0 var(--fx-space-xs);\n\t\t\tborder-radius: var(--fx-radius-sm);\n\t\t\tfont-size: calc(var(--fx-font-size) - 2px);\n\t\t}\n\t\t.toolbar {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: var(--fx-space-sm);\n\t\t\tflex-wrap: wrap;\n\t\t\tpadding: var(--fx-space-sm) var(--fx-space-md);\n\t\t\tborder: 1px solid var(--fx-border-default);\n\t\t\tborder-bottom: none;\n\t\t\tborder-radius: var(--fx-table-radius) var(--fx-table-radius) 0 0;\n\t\t\tbackground: var(--fx-surface-background);\n\t\t}\n\t\t.toolbar:empty {\n\t\t\tdisplay: none;\n\t\t}\n\t\t.loading-overlay {\n\t\t\tposition: absolute;\n\t\t\tinset: 0;\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tgap: var(--fx-space-sm);\n\t\t\tbackground: color-mix(\n\t\t\t\tin srgb,\n\t\t\t\tvar(--fx-surface-background) 85%,\n\t\t\t\ttransparent\n\t\t\t);\n\t\t\tbackdrop-filter: blur(2px);\n\t\t\tz-index: 10;\n\t\t\tborder-radius: var(--fx-table-radius) var(--fx-table-radius) 0 0;\n\t\t}\n\t\t.tbl-spinner {\n\t\t\twidth: 32px;\n\t\t\theight: 32px;\n\t\t\tborder: 3px solid var(--fx-border-default);\n\t\t\tborder-top-color: var(--fx-color-primary);\n\t\t\tborder-radius: 50%;\n\t\t\tanimation: tbl-spin 1s linear infinite;\n\t\t}\n\t\t@keyframes tbl-spin {\n\t\t\tto {\n\t\t\t\ttransform: rotate(360deg);\n\t\t\t}\n\t\t}\n\t\t.loading-text {\n\t\t\tcolor: var(--fx-text-muted);\n\t\t\tfont-size: calc(var(--fx-font-size) - 1px);\n\t\t}\n\t`;\n\n\tstatic override get observedAttributes(): string[] {\n\t\treturn [\n\t\t\t\"pagination\",\n\t\t\t\"rows\",\n\t\t\t\"rows-options\",\n\t\t\t\"striped\",\n\t\t\t\"hover\",\n\t\t\t\"toolbar\",\n\t\t\t\"empty-message\",\n\t\t\t\"pagination-position\",\n\t\t\t\"lazy\",\n\t\t\t\"total\",\n\t\t\t\"loading\",\n\t\t\t\"loading-message\",\n\t\t\t\"sort-field\",\n\t\t\t\"sort-order\",\n\t\t\t\"rounded\",\n\t\t\t\"radius\",\n\t\t\t\"no-borders-x\",\n\t\t];\n\t}\n\n\tprivate _data: Record<string, unknown>[] = [];\n\tprivate _total?: number;\n\tprivate page = 0;\n\tprivate sortField = \"\";\n\tprivate sortDir: 1 | -1 = 1;\n\tprivate filters: Record<string, string> = {};\n\tprivate globalSearch = \"\";\n\tprivate _columnObserver?: MutationObserver;\n\n\tget data(): Record<string, unknown>[] {\n\t\treturn this._data;\n\t}\n\tset data(value: Record<string, unknown>[]) {\n\t\tthis._data = Array.isArray(value) ? value : [];\n\t\tthis.render();\n\t}\n\n\tget total(): number {\n\t\treturn this._total ?? this._data.length;\n\t}\n\tset total(value: number) {\n\t\tthis._total = value;\n\t\tthis.setAttribute(\"total\", String(value));\n\t}\n\n\tget rowsPerPage(): number {\n\t\tconst r = Number(this.getAttr(\"rows\", \"10\"));\n\t\treturn r > 0 ? r : 10;\n\t}\n\tset rowsPerPage(value: number) {\n\t\tthis.setAttribute(\"rows\", String(value));\n\t}\n\n\tget lazy(): boolean {\n\t\treturn this.hasAttr(\"lazy\");\n\t}\n\n\tprivate get columns(): {\n\t\tfield: string;\n\t\theader: string;\n\t\tsortable: boolean;\n\t\tfilterable: boolean;\n\t\talign: string;\n\t\ttemplate?: HTMLElement;\n\t\tdirectTemplate?: string;\n\t}[] {\n\t\treturn [...this.querySelectorAll(\"fx-column\")].map((c) => {\n\t\t\tconst tpl = this._resolveCellTemplate(c);\n\t\t\tconst direct = tpl ? undefined : c.innerHTML.trim();\n\t\t\tconst align = c.getAttribute(\"align\") ?? \"left\";\n\t\t\treturn {\n\t\t\t\tfield: c.getAttribute(\"field\") ?? \"\",\n\t\t\t\theader: c.getAttribute(\"header\") ?? c.getAttribute(\"field\") ?? \"\",\n\t\t\t\tsortable: c.hasAttribute(\"sortable\"),\n\t\t\t\tfilterable: c.hasAttribute(\"filterable\"),\n\t\t\t\talign: [\"left\", \"center\", \"right\", \"justify\", \"start\", \"end\"].includes(align) ? align : \"left\",\n\t\t\t\ttemplate: tpl ?? undefined,\n\t\t\t\tdirectTemplate: direct || undefined,\n\t\t\t};\n\t\t});\n\t}\n\n\t/**\n\t * Resolve o template de célula de uma `<fx-column>`, em ordem de prioridade:\n\t *\n\t * 1. `<fx-cell>` — **recomendado**. Tag própria, sem significado especial\n\t * para Vue/React/Angular/Svelte: nenhum framework a intercepta, então o\n\t * `innerHTML` sempre chega intacto ao componente. O light DOM do\n\t * `<fx-table>` não é exibido (a tabela não usa `<slot>`), então o\n\t * conteúdo-fonte nunca aparece na tela.\n\t *\n\t * ⚠️ O conteúdo é TEXTO CRU para o motor de expressões: o `{{ }}` NÃO é\n\t * interpretado pelo framework hospedeiro. Cada um precisa neutralizar a\n\t * própria sintaxe antes (ver o cabeçalho do arquivo): `v-pre` no Vue,\n\t * `{'{{ }}'}` no JSX, `ngNonBindable` no Angular, string/entidades no\n\t * Svelte. Sem isso o template não chega ao `renderCell`.\n\t * 2. `template=\"#id\"` (ou `template=\"id\"`) — aponta para um `<template>`\n\t * declarado **fora** da tabela, útil em React/Angular, onde é mais\n\t * simples manter o markup num único lugar.\n\t * 3. `<template>` dentro da coluna — forma **legada**, mantida por\n\t * compatibilidade. Em Vue 3 ela vira um bloco do compilador e em React os\n\t * filhos são gerenciados pelo framework; nos dois casos o `innerHTML`\n\t * chega vazio e a célula não renderiza. Prefira `<fx-cell>`.\n\t */\n\tprivate _resolveCellTemplate(c: Element): HTMLElement | null {\n\t\tconst cell = c.querySelector<HTMLElement>(\":scope > fx-cell\");\n\t\tif (cell) return cell;\n\t\tconst ref = c.getAttribute(\"template\");\n\t\tif (ref) {\n\t\t\tconst alvo = this._resolveRef(ref);\n\t\t\tif (alvo) return alvo;\n\t\t}\n\t\treturn c.querySelector<HTMLElement>(\"template\");\n\t}\n\n\tprivate get toolbarTemplate(): HTMLElement | null {\n\t\t// Mesma lógica da célula: `<fx-toolbar>` > `toolbar=\"#id\"` > legado.\n\t\tconst bar = this.querySelector<HTMLElement>(\":scope > fx-toolbar\");\n\t\tif (bar) return bar;\n\t\tconst ref = this.getAttr(\"toolbar\");\n\t\tif (ref) {\n\t\t\tconst alvo = this._resolveRef(ref);\n\t\t\tif (alvo) return alvo;\n\t\t}\n\t\treturn this.querySelector<HTMLElement>('template[slot=\"toolbar\"]');\n\t}\n\n\t/**\n\t * Resolve `ref` para um elemento: `#id`/`id` ⇒ `getElementById` no\n\t * documento; qualquer outro valor é tratado como seletor CSS relativo à\n\t * própria tabela. Valores inválidos devolvem `null` (sem exceção).\n\t */\n\tprivate _resolveRef(ref: string): HTMLElement | null {\n\t\tconst valor = ref.trim();\n\t\tif (!valor) return null;\n\t\tconst doc = this.ownerDocument;\n\t\tif (valor.startsWith('#')) return doc?.getElementById(valor.slice(1)) ?? null;\n\t\tif (/^[.#[>]/.test(valor)) {\n\t\t\ttry {\n\t\t\t\treturn this.querySelector<HTMLElement>(valor);\n\t\t\t} catch {\n\t\t\t\treturn null; // seletor inválido — degrada para o próximo fallback\n\t\t\t}\n\t\t}\n\t\treturn doc?.getElementById(valor) ?? null;\n\t}\n\n\tprotected override connectedCallback(): void {\n\t\tthis._parseDataAttribute();\n\t\tthis._parseSortAttributes();\n\t\t// O pager usa glifos da Fenix Icons: garante o @font-face mesmo quando o\n\t\t// app não importou `@wrrdev/fenix-ui/icons` (idempotente).\n\t\tloadFenixIconsFont();\n\t\tsuper.connectedCallback();\n\t\tthis._columnObserver = new MutationObserver(() => this.render());\n\t\tthis._columnObserver.observe(this, { childList: true, subtree: true });\n\t}\n\n\tprotected override disconnectedCallback(): void {\n\t\tthis._columnObserver?.disconnect();\n\t\tsuper.disconnectedCallback();\n\t}\n\n\t/** Ordenação inicial via `sort-field` / `sort-order` (documentados na API). */\n\tprivate _parseSortAttributes(): void {\n\t\tconst field = this.getAttr(\"sort-field\");\n\t\tif (field) this.sortField = field;\n\t\tconst order = this.getAttr(\"sort-order\");\n\t\tif (order === \"asc\" || order === \"desc\") this.sortDir = order === \"asc\" ? 1 : -1;\n\t}\n\n\tprivate _parseDataAttribute(): void {\n\t\tif (!this._data.length) {\n\t\t\ttry {\n\t\t\t\tconst json = this.getAttr(\"data\");\n\t\t\t\tif (json) this._data = JSON.parse(json);\n\t\t\t} catch {\n\t\t\t\t/* atributo invalido - ignora */\n\t\t\t}\n\t\t}\n\t\tconst totalAttr = this.getAttr(\"total\");\n\t\tif (totalAttr) {\n\t\t\tconst n = Number(totalAttr);\n\t\t\tif (!isNaN(n)) this._total = n;\n\t\t}\n\t}\n\n\tprivate computeRows(): { rows: Record<string, unknown>[]; total: number } {\n\t\tlet out = [...this._data];\n\n\t\tfor (const [field, term] of Object.entries(this.filters)) {\n\t\t\tif (!term) continue;\n\t\t\tconst t = term.toLowerCase();\n\t\t\tout = out.filter((r) =>\n\t\t\t\tString(r[field] ?? \"\")\n\t\t\t\t\t.toLowerCase()\n\t\t\t\t\t.includes(t),\n\t\t\t);\n\t\t}\n\n\t\tif (this.globalSearch) {\n\t\t\tconst t = this.globalSearch.toLowerCase();\n\t\t\tconst searchFields = this._getSearchFields();\n\t\t\tout = out.filter((r) => {\n\t\t\t\tconst fields = searchFields.length ? searchFields : Object.keys(r);\n\t\t\t\treturn fields.some((f) =>\n\t\t\t\t\tString(r[f] ?? \"\")\n\t\t\t\t\t\t.toLowerCase()\n\t\t\t\t\t\t.includes(t),\n\t\t\t\t);\n\t\t\t});\n\t\t}\n\n\t\tconst total = this.lazy ? this.total : out.length;\n\n\t\tif (this.sortField) {\n\t\t\tout.sort((a, b) => {\n\t\t\t\tconst av = a[this.sortField],\n\t\t\t\t\tbv = b[this.sortField];\n\t\t\t\tif (typeof av === \"number\" && typeof bv === \"number\")\n\t\t\t\t\treturn (av - bv) * this.sortDir;\n\t\t\t\treturn (\n\t\t\t\t\tString(av ?? \"\").localeCompare(String(bv ?? \"\"), \"pt-BR\") *\n\t\t\t\t\tthis.sortDir\n\t\t\t\t);\n\t\t\t});\n\t\t}\n\n\t\tif (this.hasAttr(\"pagination\") && !this.lazy) {\n\t\t\tconst start = this.page * this.rowsPerPage;\n\t\t\tout = out.slice(start, start + this.rowsPerPage);\n\t\t}\n\n\t\treturn { rows: out, total };\n\t}\n\n\tprivate _getSearchFields(): string[] {\n\t\tconst input = this.root.querySelector<HTMLInputElement>(\n\t\t\t\"[data-search-fields]\",\n\t\t);\n\t\tif (!input) return [];\n\t\tconst attr = input.getAttribute(\"data-search-fields\");\n\t\tif (attr === null) return [];\n\t\treturn attr\n\t\t\t.split(\",\")\n\t\t\t.map((s) => s.trim())\n\t\t\t.filter(Boolean);\n\t}\n\n\tprivate cellHtml(\n\t\tcol: {\n\t\t\tfield: string;\n\t\t\ttemplate?: HTMLElement;\n\t\t\tdirectTemplate?: string;\n\t\t},\n\t\trow: Record<string, unknown>,\n\t): string {\n\t\tconst template = col.template?.innerHTML ?? col.directTemplate;\n\t\tif (template) return renderCell(template, row, col.field);\n\t\treturn esc(String(row[col.field] ?? \"\"));\n\t}\n\n\t/**\n\t * Assinatura da \"casca\" da tabela: tudo que NÃO depende das linhas\n\t * (colunas, toolbar, filtros, paginação, loading).\n\t *\n\t * Serve para o caminho rápido: quando só `data` muda, a casca é idêntica e\n\t * podemos trocar apenas o `<tbody>`, sem recriar `<style>`, `<thead>`,\n\t * toolbar e paginação — nem religar todos os listeners.\n\t */\n\tprivate _shellKey = '';\n\n\tprotected override render(): void {\n\t\tconst cols = this.columns.filter((c) => c.field);\n\t\tconst { rows, total } = this.computeRows();\n\t\tconst paginated = this.hasAttr(\"pagination\");\n\t\tconst pages = Math.max(1, Math.ceil(total / this.rowsPerPage));\n\t\tif (this.page >= pages) this.page = pages - 1;\n\n\t\tconst toolbar = this.toolbarTemplate;\n\t\tconst toolbarHtml = toolbar\n\t\t\t? `<div class=\"toolbar\" part=\"toolbar\">${toolbar.innerHTML}</div>`\n\t\t\t: \"\";\n\n\t\tconst headHtml = cols\n\t\t\t.map((c) => {\n\t\t\t\tconst isSorted = this.sortField === c.field;\n\t\t\t\tconst ind = isSorted\n\t\t\t\t\t? this.sortDir === 1\n\t\t\t\t\t\t? \"▲\"\n\t\t\t\t\t\t: \"▼\"\n\t\t\t\t\t: c.sortable\n\t\t\t\t\t\t? \"⇅\"\n\t\t\t\t\t\t: \"\";\n\t\t\t\tconst activeClass = isSorted ? \"active\" : \"\";\n\t\t\t\treturn `<th part=\"header\" class=\"${c.sortable ? \"sortable\" : \"\"}\" style=\"text-align:${c.align}\" data-field=\"${esc(c.field)}\">${esc(c.header)}${ind ? `<span class=\"sort-ind ${activeClass}\">${ind}</span>` : \"\"}</th>`;\n\t\t\t})\n\t\t\t.join(\"\");\n\n\t\tconst filterRow = cols.some((c) => c.filterable)\n\t\t\t? `<tr class=\"filter-row\">${cols.map((c) => `<th style=\"text-align:${c.align}\">${c.filterable ? `<input class=\"filter\" data-field=\"${esc(c.field)}\" placeholder=\"${esc(\"Filtrar…\")}\" value=\"${esc(this.filters[c.field] ?? \"\")}\">` : \"\"}</th>`).join(\"\")}</tr>`\n\t\t\t: \"\";\n\n\t\tconst bodyHtml = rows.length\n\t\t\t? rows\n\t\t\t\t\t.map(\n\t\t\t\t\t\t(row, i) =>\n\t\t\t\t\t\t\t`<tr part=\"row\" data-index=\"${i}\">${cols.map((c) => `<td part=\"cell\" style=\"text-align:${c.align}\">${this.cellHtml(c, row)}</td>`).join(\"\")}</tr>`,\n\t\t\t\t\t)\n\t\t\t\t\t.join(\"\")\n\t\t\t: `<tr><td class=\"empty\" colspan=\"${cols.length || 1}\">${esc(this.getAttr(\"empty-message\", \"Nenhum registro encontrado\"))}</td></tr>`;\n\n\t// Janela de páginas: primeira + última + vizinhas da atual, com elipse no\n\t// miolo. Sem isso, com 1.000 páginas o rodapé renderizava 1.000 botões.\n\tconst pageButtons = pageRange(this.page + 1, pages)\n\t\t.map((item) =>\n\t\t\titem === \"ellipsis\"\n\t\t\t\t? `<span class=\"ellipsis\" part=\"ellipsis\" aria-hidden=\"true\">…</span>`\n\t\t\t\t: `<button type=\"button\" class=\"pg-btn\" part=\"page\" data-pg=\"${item - 1}\"${item === this.page + 1 ? ' aria-current=\"page\"' : \"\"}>${item}</button>`,\n\t\t)\n\t\t.join(\"\");\n\n\t\tconst pagerHtml = !paginated\n\t\t\t? \"\"\n\t\t\t: `\n <div class=\"pager\" part=\"pager\">\n <span class=\"info\">Página ${this.page + 1} de ${pages} · ${total} registros</span>\n <button type=\"button\" class=\"pg-btn\" part=\"first\" aria-label=\"Primeira página\" data-pg=\"first\" ${this.page === 0 ? \"disabled\" : \"\"}>${fenixIconHtml(\"first_page\")}</button>\n <button type=\"button\" class=\"pg-btn\" part=\"prev\" aria-label=\"Página anterior\" data-pg=\"prev\" ${this.page === 0 ? \"disabled\" : \"\"}>${fenixIconHtml(\"navigate_before\")}</button>\n ${pageButtons}\n <button type=\"button\" class=\"pg-btn\" part=\"next\" aria-label=\"Próxima página\" data-pg=\"next\" ${this.page >= pages - 1 ? \"disabled\" : \"\"}>${fenixIconHtml(\"navigate_next\")}</button>\n <button type=\"button\" class=\"pg-btn\" part=\"last\" aria-label=\"Última página\" data-pg=\"last\" ${this.page >= pages - 1 ? \"disabled\" : \"\"}>${fenixIconHtml(\"last_page\")}</button>\n <label class=\"info\">${esc(\"Por página:\")}\n <fx-select class=\"rows-sel\" size=\"sm\" value=\"${this.rowsPerPage}\" aria-label=\"Itens por página\">${this.getAttr(\n\t\t\t\t\t\"rows-options\",\n\t\t\t\t\t\"5,10,20,50\",\n\t\t\t\t)\n\t\t\t\t\t.split(\",\")\n\t\t\t\t\t.map((n) => n.trim())\n\t\t\t\t\t.map((n) => `<option value=\"${esc(n)}\">${esc(n)}</option>`)\n\t\t\t\t\t.join(\"\")}</fx-select>\n </label>\n </div>`;\n\n\t\tconst loading = this.hasAttr(\"loading\");\n\t\tconst loadingHtml = loading\n\t\t\t? `<div class=\"loading-overlay\" part=\"loading-overlay\"><div class=\"tbl-spinner\" part=\"spinner\"></div><span class=\"loading-text\">${esc(this.getAttr(\"loading-message\", \"Carregando…\"))}</span></div>`\n\t\t\t: \"\";\n\n\t\t// Caminho rápido: se a casca não mudou (só `data` foi substituído),\n\t\t// troca APENAS o <tbody>. Evita recriar <style>/<thead>/toolbar/pager e\n\t\t// religar todos os listeners a cada atribuição de `data` — que é o\n\t\t// gargalo em tabelas grandes (busca por tecla, paginação, reload).\n\t\tconst shellKey = [\n\t\t\ttoolbarHtml,\n\t\t\theadHtml,\n\t\t\tfilterRow,\n\t\t\tpagerHtml,\n\t\t\tloadingHtml,\n\t\t\tcols.length,\n\t\t].join(\"|\");\n\t\tif (shellKey === this._shellKey) {\n\t\t\tconst tbody = this.root.querySelector(\"tbody\");\n\t\t\tif (tbody) {\n\t\t\t\ttbody.innerHTML = bodyHtml;\n\t\t\t\tthis._bindRowClicks(rows);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tthis._shellKey = shellKey;\n\n\t\tthis.setTemplate(`\n ${toolbarHtml}\n <div class=\"frame${toolbar ? \" has-toolbar\" : \"\"}\" part=\"frame\">\n <div class=\"table-wrap\">\n <div class=\"scroll\">\n <table part=\"table\">\n <thead><tr>${headHtml}</tr>${filterRow}</thead>\n <tbody>${bodyHtml}</tbody>\n </table>\n </div>\n ${loadingHtml}\n </div>\n ${pagerHtml}\n </div>\n `);\n\n\t\t// Ordenação.\n\t\tthis.root\n\t\t\t.querySelectorAll<HTMLTableCellElement>(\"th.sortable\")\n\t\t\t.forEach((th) => {\n\t\t\t\tth.addEventListener(\"click\", () => {\n\t\t\t\t\tconst f = th.dataset.field!;\n\t\t\t\t\tif (this.sortField === f)\n\t\t\t\t\t\tthis.sortDir = this.sortDir === 1 ? -1 : 1;\n\t\t\t\t\telse {\n\t\t\t\t\t\tthis.sortField = f;\n\t\t\t\t\t\tthis.sortDir = 1;\n\t\t\t\t\t}\n\t\t\t\t\tthis.render();\n\t\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\t\tnew CustomEvent(\"sort-change\", {\n\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\t\tdetail: {\n\t\t\t\t\t\t\t\tfield: this.sortField,\n\t\t\t\t\t\t\t\tdirection: this.sortDir === 1 ? \"asc\" : \"desc\",\n\t\t\t\t\t\t\t\tlazy: this.lazy,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t\t});\n\n\t\t// Filtros (preserva foco/caret ao digitar).\n\t\tthis.root.querySelectorAll<HTMLInputElement>(\".filter\").forEach((inp) => {\n\t\t\tinp.addEventListener(\"input\", () => {\n\t\t\t\tconst field = inp.dataset.field!;\n\t\t\t\tconst value = inp.value;\n\t\t\t\tconst pos = inp.selectionStart;\n\t\t\t\tthis.filters[field] = value;\n\t\t\t\tthis.page = 0;\n\t\t\t\tthis.render();\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent(\"filter-change\", {\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\tdetail: { field, value, lazy: this.lazy },\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t\tconst again = this.root.querySelector<HTMLInputElement>(\n\t\t\t\t\t`.filter[data-field=\"${esc(field)}\"]`,\n\t\t\t\t);\n\t\t\t\tif (again) {\n\t\t\t\t\tagain.focus();\n\t\t\t\t\tagain.setSelectionRange(pos, pos);\n\t\t\t\t}\n\t\t\t});\n\t\t\tinp.addEventListener(\"click\", (e) => e.stopPropagation());\n\t\t});\n\n\t\t// Busca global da toolbar.\n\t\tthis.root\n\t\t\t.querySelectorAll<HTMLInputElement>(\"[data-search-fields]\")\n\t\t\t.forEach((inp) => {\n\t\t\t\tinp.addEventListener(\"input\", () => {\n\t\t\t\t\tthis.globalSearch = inp.value;\n\t\t\t\t\tthis.page = 0;\n\t\t\t\t\tconst pos = inp.selectionStart;\n\t\t\t\t\tthis.render();\n\t\t\t\t\tconst again = this.root.querySelector<HTMLInputElement>(\n\t\t\t\t\t\t\"[data-search-fields]\",\n\t\t\t\t\t);\n\t\t\t\t\tif (again) {\n\t\t\t\t\t\tagain.focus();\n\t\t\t\t\t\tagain.setSelectionRange(pos, pos);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\n\t\t// Paginação.\n\t\tthis.root\n\t\t\t.querySelectorAll<HTMLButtonElement>(\".pg-btn\")\n\t\t\t.forEach((btn) => {\n\t\t\t\tbtn.addEventListener(\"click\", () => {\n\t\t\t\t\tconst pg = btn.dataset.pg!;\n\t\t\t\t\tthis.page =\n\t\t\t\t\t\tpg === \"first\"\n\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t: pg === \"prev\"\n\t\t\t\t\t\t\t\t? Math.max(0, this.page - 1)\n\t\t\t\t\t\t\t\t: pg === \"next\"\n\t\t\t\t\t\t\t\t\t? Math.min(pages - 1, this.page + 1)\n\t\t\t\t\t\t\t\t\t: pg === \"last\"\n\t\t\t\t\t\t\t\t\t\t? pages - 1\n\t\t\t\t\t\t\t\t\t\t: Number(pg);\n\t\t\t\t\tthis.render();\n\t\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\t\tnew CustomEvent(\"page-change\", {\n\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\t\tdetail: {\n\t\t\t\t\t\t\t\tpage: this.page + 1,\n\t\t\t\t\t\t\t\tpages,\n\t\t\t\t\t\t\t\trowsPerPage: this.rowsPerPage,\n\t\t\t\t\t\t\t\ttotal,\n\t\t\t\t\t\t\t\tlazy: this.lazy,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t\t});\n\t\tthis.root\n\t\t\t.querySelector<HTMLElement>(\"fx-select.rows-sel\")\n\t\t\t?.addEventListener(\"change\", (e) => {\n\t\t\t\tconst value = Number((e as CustomEvent).detail?.value);\n\t\t\t\tif (!value || value === this.rowsPerPage) return;\n\t\t\t\tthis.rowsPerPage = value;\n\t\t\t\tthis.page = 0;\n\t\t\t\tthis.render();\n\t\t\t});\n\n\t\t// Clique na linha.\n\t\tthis._bindRowClicks(rows);\n\n\t\tthis._restoreToolbarSearch();\n\t}\n\n\t/**\n\t * Liga o clique das linhas ao evento `row-click`.\n\t *\n\t * Extraído do render para ser reaproveitado no caminho rápido (troca só do\n\t * <tbody>): os <tr> são novos, então precisam ser rebound.\n\t */\n\tprivate _bindRowClicks(rows: Record<string, unknown>[]): void {\n\t\tthis.root\n\t\t\t.querySelectorAll<HTMLTableRowElement>(\"tbody tr[data-index]\")\n\t\t\t.forEach((tr) => {\n\t\t\t\ttr.addEventListener(\"click\", () => {\n\t\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\t\tnew CustomEvent(\"row-click\", {\n\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\t\tdetail: {\n\t\t\t\t\t\t\t\trow: rows[Number(tr.dataset.index)],\n\t\t\t\t\t\t\t\tindex: Number(tr.dataset.index),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t\t});\n\t}\n\n\tprivate _restoreToolbarSearch(): void {\n\t\tconst input = this.root.querySelector<HTMLInputElement>(\n\t\t\t\"[data-search-fields]\",\n\t\t);\n\t\tif (input && this.globalSearch) input.value = this.globalSearch;\n\t}\n}\n\nexport function defineFxTable(): typeof FxTable {\n return defineElement('fx-table', FxTable);\n}\n"],"names":[],"mappings":";;;;;;;;;AA2DO,MAAM,WAAN,MAAM,iBAAgB,UAAU;AAAA,EAAhC,cAAA;AAAA,UAAA,GAAA,SAAA;AAwTN,SAAQ,QAAmC,CAAA;AAE3C,SAAQ,OAAO;AACf,SAAQ,YAAY;AACpB,SAAQ,UAAkB;AAC1B,SAAQ,UAAkC,CAAA;AAC1C,SAAQ,eAAe;AAoPvB,SAAQ,YAAY;AAAA,EAAA;A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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAFhB,IAAM,UAAN;AAi0BA,SAAS,gBAAgC;AAC9C,SAAO,cAAc,YAAY,OAAO;AAC1C;"}
|
|
1
|
+
{"version":3,"file":"table.js","sources":["../../../src/components/table/table.ts"],"sourcesContent":["import { FxElement } from '../../core/base';\nimport { css } from '../../core/css';\nimport { defineElement } from '../../core/define';\nimport { pageRange } from '../../core/page-range';\nimport { esc } from \"../../core/sanitize\";\nimport { FENIX_ICON_BASE_CSS, fenixIconHtml } from '../../icons/base-css';\nimport { loadFenixIconsFont } from '../../icons/font';\nimport { renderCell } from \"./expr\";\nimport \"../select\";\n\n/**\n * <fx-table> — Tabela de dados estilo DataTable (dados + colunas configuráveis,\n * ordenação, filtros por coluna, paginação personalizável, busca global na toolbar\n * e modo lazy para busca no servidor).\n *\n * Colunas (light DOM):\n * <fx-column field=\"nome\" header=\"Nome\" sortable filterable align=\"left\">\n * opcional: <fx-cell>R$ {{value}}</fx-cell> para render customizado\n * ou conteúdo direto (HTML + {{ }}) como template alternativo\n * </fx-column>\n *\n * IMPORTANTE (frameworks): use <fx-cell>, NÃO <template>. A tag nativa\n * <template> é reservada — o Vue 3 a transforma em bloco do compilador e o\n * React gerencia os filhos, então o innerHTML chega vazio. <fx-cell> é uma\n * tag própria, sem significado especial para nenhum framework. A forma\n * antiga com <template> continua funcionando (compatibilidade) e há ainda\n * a opção `template=\"#id\"` apontando para um <template> externo.\n *\n * ⚠️ REGRA DO v-pre (Vue) — o conteúdo do <fx-cell> é TEXTO CRU:\n * {{ }} é avaliado pelo motor de expressões do <fx-table> (./expr.ts) e\n * NÃO pelo Vue. Sem `v-pre`, o compilador do Vue consome a interpolação\n * antes: emite `_toDisplayString(_ctx.value | _ctx.number)`, o conteúdo\n * chega sem as chaves no innerHTML e o vue-tsc acusa `value`/`number`\n * inexistentes no escopo. → SEMPRE use <fx-cell v-pre> no Vue.\n *\n * Cada framework tem a sua neutralização (todas verificadas por compilador):\n * - Vue 3 / Nuxt .... v-pre <fx-cell v-pre>{{ value }}</fx-cell>\n * - React / JSX ..... string JS <fx-cell>{'{{ value }}'}</fx-cell>\n * (o `{{ }}` solto é ERRO de sintaxe no parser JSX)\n * - Angular ......... ngNonBindable <fx-cell ngNonBindable>…</fx-cell>\n * - Svelte .......... string JS ou entidades HTML\n * {'{{ value }}'} ou {{ value }}\n * - HTML/CDN/JSF/JSP nada <fx-cell>{{ value }}</fx-cell>\n *\n * Toolbar (opcional):\n * <fx-toolbar>\n * <input data-search-fields=\"nome,cargo\" placeholder=\"Buscar…\">\n * <button>Nova ação</button>\n * </fx-toolbar>\n * (legado ainda aceito: <template slot=\"toolbar\">…</template>)\n *\n * Dados: propriedade `data` (array de objetos) ou atributo `data` (JSON).\n *\n * Atributos: pagination, rows, rows-options, pagination-position (left|center|right),\n * striped, hover, empty-message, lazy, total, loading, loading-message,\n * sort-field, sort-order, rounded (none|sm|md|lg, padrão md; `radius` é alias),\n * no-borders-x (remove apenas as bordas laterais, mantendo topo e base).\n * Eventos: page-change, sort-change, row-click, filter-change (todos composed).\n */\nexport class FxTable extends FxElement {\n\tstatic override styles = css`\n\t\t${FENIX_ICON_BASE_CSS}\n\t\t:host {\n\t\t\tdisplay: block;\n\t\t\tfont-family: var(--fx-font-family);\n\t\t\tfont-size: var(--fx-font-size);\n\t\t\tcolor: var(--fx-text-default);\n\t\t\tbackground: var(--fx-surface-background);\n\t\t\t/* Raio da moldura (tabela + paginação). O atributo \"rounded\"\n\t\t\t sobrescreve este valor e o consumidor também pode sobrescrever\n\t\t\t por CSS: fx-table { --fx-table-radius: 20px; }. */\n\t\t\t--fx-table-radius: var(--fx-radius-md);\n\t\t}\n\t\t/* Arredondamento das bordas — \"none\" deixa tudo reto, como nos demais\n\t\t tokens de radius do design system. \"rounded\" é o nome atual; \"radius\"\n\t\t segue aceito como alias para ficar consistente com o <fx-card>. */\n\t\t:host([rounded=\"none\"]),\n\t\t:host([radius=\"none\"]) {\n\t\t\t--fx-table-radius: var(--fx-radius-none, 0);\n\t\t}\n\t\t:host([rounded=\"sm\"]),\n\t\t:host([radius=\"sm\"]) {\n\t\t\t--fx-table-radius: var(--fx-radius-sm);\n\t\t}\n\t\t:host([rounded=\"md\"]),\n\t\t:host([radius=\"md\"]) {\n\t\t\t--fx-table-radius: var(--fx-radius-md);\n\t\t}\n\t\t:host([rounded=\"lg\"]),\n\t\t:host([radius=\"lg\"]) {\n\t\t\t--fx-table-radius: var(--fx-radius-lg);\n\t\t}\n\t\t/* Moldura: uma única borda envolvendo a tabela E a paginação, para que\n\t\t o pager não fique \"solto\" fora do contorno da tabela. */\n\t\t.frame {\n\t\t\tborder: 1px solid var(--fx-border-default);\n\t\t\tborder-radius: var(--fx-table-radius);\n\t\t\tbackground: var(--fx-surface-background);\n\t\t}\n\t\t/* Com toolbar no topo, quem desenha a borda superior é a própria\n\t\t toolbar — a moldura desenha apenas o contorno restante. */\n\t\t.frame.has-toolbar {\n\t\t\tborder-top: none;\n\t\t}\n\t\t/* \"no-borders-x\": mantém somente as bordas de topo e de base\n\t\t (tabela encaixada em um layout que já desenha as laterais). */\n\t\t:host([no-borders-x]) .frame,\n\t\t:host([no-borders-x]) .toolbar {\n\t\t\tborder-left: none;\n\t\t\tborder-right: none;\n\t\t}\n\t\t.table-wrap {\n\t\t\tposition: relative;\n\t\t}\n\t\t.scroll {\n\t\t\toverflow-x: auto;\n\t\t\t/* O topo acompanha o raio da moldura; a base fica reta porque o\n\t\t\t rodapé (.pager) é quem a desenha. */\n\t\t\tborder-radius: var(--fx-table-radius) var(--fx-table-radius) 0 0;\n\t\t}\n\t\t/* Sem paginação não existe rodapé: a moldura fecha embaixo. */\n\t\t:host(:not([pagination])) .scroll {\n\t\t\tborder-radius: var(--fx-table-radius);\n\t\t}\n\t\ttable {\n\t\t\twidth: 100%;\n\t\t\tborder-collapse: collapse;\n\t\t}\n\t\tth {\n\t\t\ttext-align: left;\n\t\t\tpadding: var(--fx-space-sm) var(--fx-space-md);\n\t\t\tbackground: var(--fx-surface-surface);\n\t\t\tborder-bottom: 2px solid var(--fx-border-default);\n\t\t\twhite-space: nowrap;\n\t\t\tuser-select: none;\n\t\t\t/* Cor/peso do cabeçalho por token de TABELA. Sem isso o th herda\n\t\t\t --fx-text-default do host e o peso vem do UA (bold). */\n\t\t\tcolor: var(\n\t\t\t\t--fx-table-header-text,\n\t\t\t\tvar(--fx-table-text, var(--fx-text-default))\n\t\t\t);\n\t\t\tfont-weight: var(--fx-table-header-weight, bold);\n\t\t}\n\t\tth.sortable {\n\t\t\tcursor: pointer;\n\t\t}\n\t\tth.sortable:hover {\n\t\t\tcolor: var(--fx-color-primary);\n\t\t}\n\t\t.sort-ind {\n\t\t\tfont-size: calc(var(--fx-font-size) - 4px);\n\t\t\tmargin-left: var(--fx-space-3xs, 2px);\n\t\t\topacity: 0.45;\n\t\t\ttransition: opacity var(--fx-motion-duration-fast)\n\t\t\t\tvar(--fx-motion-easing);\n\t\t}\n\t\tth.sortable:hover .sort-ind {\n\t\t\topacity: 0.85;\n\t\t}\n\t\t.sort-ind.active {\n\t\t\topacity: 1;\n\t\t\tcolor: var(--fx-color-primary);\n\t\t}\n\t\t.filter-row th {\n\t\t\tpadding: var(--fx-space-3xs, 4px) var(--fx-space-md) var(--fx-space-sm);\n\t\t\tborder-bottom-width: 1px;\n\t\t}\n\t\t.filter {\n\t\t\twidth: 100%;\n\t\t\tbox-sizing: border-box;\n\t\t\tfont: inherit;\n\t\t\tfont-size: calc(var(--fx-font-size) - 2px);\n\t\t\tcolor: var(--fx-text-default);\n\t\t\tbackground: var(--fx-surface-background);\n\t\t\tborder: 1px solid var(--fx-border-default);\n\t\t\tborder-radius: var(--fx-radius-sm);\n\t\t\tpadding: var(--fx-space-3xs, 4px) var(--fx-space-xs);\n\t\t\toutline: none;\n\t\t}\n\t\t.filter:focus {\n\t\t\tborder-color: var(--fx-color-primary);\n\t\t\tbox-shadow: var(--fx-effect-focus-ring, none);\n\t\t}\n\t\ttd {\n\t\t\tpadding: var(--fx-space-sm) var(--fx-space-md);\n\t\t\tborder-bottom: 1px solid var(--fx-border-default);\n\t\t\t/* Texto do corpo: token próprio para não depender de\n\t\t\t --fx-text-default (que afeta TODOS os textos do app) e para\n\t\t\t não herdar o font-weight do body da página — era isso que\n\t\t\t fazia a célula parecer mais clara que o cabeçalho. */\n\t\t\tcolor: var(--fx-table-text, var(--fx-text-default));\n\t\t\tfont-weight: var(--fx-table-text-weight, inherit);\n\t\t}\n\t\ttbody tr {\n\t\t\tcursor: pointer;\n\t\t\ttransition: background-color var(--fx-motion-duration-fast)\n\t\t\t\tvar(--fx-motion-easing);\n\t\t}\n\t\t/* Listrado: alterna a superfície (cinza). Antes usava\n\t\t --fx-surface-background, que é a MESMA cor do fundo do :host e\n\t\t portanto pintava branco sobre branco (listrado invisível). */\n\t\t:host([striped]) tbody tr:nth-child(even) {\n\t\t\tbackground: var(--fx-surface-surface, #f8fafc);\n\t\t}\n\t\t/* O hover é opt-in via atributo (o clique na linha continua sempre ativo). */\n\t\t:host([hover]) tbody tr:hover {\n\t\t\tbackground: color-mix(\n\t\t\t\tin srgb,\n\t\t\t\tvar(--fx-color-primary) 8%,\n\t\t\t\ttransparent\n\t\t\t);\n\t\t}\n\t\t.empty {\n\t\t\ttext-align: center;\n\t\t\tpadding: var(--fx-space-xl);\n\t\t\tcolor: var(--fx-text-muted);\n\t\t}\n\t\t.pager {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: var(--fx-space-sm);\n\t\t\tflex-wrap: wrap;\n\t\t\t/* O rodapé é parte da moldura: borda só no topo (separando da\n\t\t\t tabela) e o mesmo padding horizontal das células. Antes ele\n\t\t\t ficava fora do contorno, sem borda e sem respiro lateral. */\n\t\t\tpadding: var(--fx-space-sm) var(--fx-space-md);\n\t\t\tborder-top: 1px solid var(--fx-border-default);\n\t\t\tborder-radius: 0 0 var(--fx-table-radius) var(--fx-table-radius);\n\t\t\tbackground: var(--fx-surface-background);\n\t\t}\n\t\t:host([pagination-position=\"center\"]) .pager {\n\t\t\tjustify-content: center;\n\t\t}\n\t\t:host([pagination-position=\"right\"]) .pager {\n\t\t\tjustify-content: flex-end;\n\t\t}\n\t\t.pager .info {\n\t\t\tcolor: var(--fx-text-muted);\n\t\t\tfont-size: calc(var(--fx-font-size) - 2px);\n\t\t}\n\t\t.pg-btn {\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tmin-width: var(--fx-size-sm);\n\t\t\theight: var(--fx-size-sm);\n\t\t\tfont: inherit;\n\t\t\tfont-size: calc(var(--fx-font-size) - 2px);\n\t\t\tcolor: var(--fx-text-default);\n\t\t\tbackground: var(--fx-surface-background);\n\t\t\tborder: 1px solid var(--fx-border-default);\n\t\t\tborder-radius: var(--fx-radius-sm);\n\t\t\tpadding: var(--fx-space-3xs, 4px) var(--fx-space-sm);\n\t\t\tcursor: pointer;\n\t\t\ttransition: border-color var(--fx-motion-duration-fast)\n\t\t\t\tvar(--fx-motion-easing);\n\t\t}\n\t\t/* O glifo precisa de 1px a mais que o dígito: a altura de traço do ícone é\n\t\t maior que a do número, então igualar os dois font-size deixa a seta\n\t\t visivelmente maior que o texto. */\n\t\t.pg-btn .fx-icon {\n\t\t\tfont-size: calc(var(--fx-font-size) - 1px);\n\t\t}\n\t\t.pg-btn:hover:not(:disabled):not([aria-current=\"page\"]) {\n\t\t\tborder-color: var(--fx-color-primary);\n\t\t\tcolor: var(--fx-color-primary);\n\t\t}\n\t\t.pg-btn:disabled {\n\t\t\topacity: 0.5;\n\t\t\tcursor: not-allowed;\n\t\t}\n\t\t.pg-btn[aria-current=\"page\"] {\n\t\t\tbackground: var(--fx-color-primary);\n\t\t\tborder-color: var(--fx-color-primary);\n\t\t\tcolor: #fff;\n\t\t\tfont-weight: var(--fx-font-weight);\n\t\t}\n\t\t/* Elipse da janela de páginas (1 … 499 [500] 501 … 1000): ocupa o\n\t\t mesmo espaço de um botão para o rodapé não \"pular\" ao navegar,\n\t\t mas não é clicável. */\n\t\t.pager .ellipsis {\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tmin-width: var(--fx-size-sm);\n\t\t\theight: var(--fx-size-sm);\n\t\t\tcolor: var(--fx-text-muted);\n\t\t\tfont-size: calc(var(--fx-font-size) - 2px);\n\t\t\tuser-select: none;\n\t\t}\n\t\t/* O seletor \"Por página\" só mostra números, então não pode herdar a\n\t\t largura padrão do <fx-select> (200px / 180px em size=\"sm\"), que\n\t\t deixava o rodapé da paginação desproporcional. O limite tem que ser\n\t\t no HOST — apertar só ::part(trigger) não funciona, porque o\n\t\t trigger é width:100% e continua herdando o min-width do host.\n\t\t O painel (dropdown) continua largo (220px) em select.ts. */\n\t\tfx-select.rows-sel {\n\t\t\tvertical-align: middle;\n\t\t\t/* Não deixa o flex do .pager esticar nem esmagar o controle. */\n\t\t\tflex: none;\n\t\t\twidth: auto;\n\t\t\t--fx-select-min-width: 56px;\n\t\t\t--fx-select-min-width-sm: 56px;\n\t\t}\n\t\tfx-select.rows-sel::part(trigger) {\n\t\t\tmin-width: 0;\n\t\t\tmin-height: var(--fx-size-sm);\n\t\t\t/* Padding curto: sobra espaço para o número + caret. */\n\t\t\tpadding: 0 var(--fx-space-xs);\n\t\t\tborder-radius: var(--fx-radius-sm);\n\t\t\tfont-size: calc(var(--fx-font-size) - 2px);\n\t\t}\n\t\t.toolbar {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: var(--fx-space-sm);\n\t\t\tflex-wrap: wrap;\n\t\t\tpadding: var(--fx-space-sm) var(--fx-space-md);\n\t\t\tborder: 1px solid var(--fx-border-default);\n\t\t\tborder-bottom: none;\n\t\t\tborder-radius: var(--fx-table-radius) var(--fx-table-radius) 0 0;\n\t\t\tbackground: var(--fx-surface-background);\n\t\t}\n\t\t.toolbar:empty {\n\t\t\tdisplay: none;\n\t\t}\n\t\t/* <fx-toolbar> é apenas um invólucro no light DOM: o slot projeta\n\t\t seus filhos (com listeners do Vue preservados) direto no flex. */\n\t\t::slotted(fx-toolbar) {\n\t\t\tdisplay: contents;\n\t\t}\n\t\t.loading-overlay {\n\t\t\tposition: absolute;\n\t\t\tinset: 0;\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tgap: var(--fx-space-sm);\n\t\t\tbackground: color-mix(\n\t\t\t\tin srgb,\n\t\t\t\tvar(--fx-surface-background) 85%,\n\t\t\t\ttransparent\n\t\t\t);\n\t\t\tbackdrop-filter: blur(2px);\n\t\t\tz-index: 10;\n\t\t\tborder-radius: var(--fx-table-radius) var(--fx-table-radius) 0 0;\n\t\t}\n\t\t.tbl-spinner {\n\t\t\twidth: 32px;\n\t\t\theight: 32px;\n\t\t\tborder: 3px solid var(--fx-border-default);\n\t\t\tborder-top-color: var(--fx-color-primary);\n\t\t\tborder-radius: 50%;\n\t\t\tanimation: tbl-spin 1s linear infinite;\n\t\t}\n\t\t@keyframes tbl-spin {\n\t\t\tto {\n\t\t\t\ttransform: rotate(360deg);\n\t\t\t}\n\t\t}\n\t\t.loading-text {\n\t\t\tcolor: var(--fx-text-muted);\n\t\t\tfont-size: calc(var(--fx-font-size) - 1px);\n\t\t}\n\t`;\n\n\tstatic override get observedAttributes(): string[] {\n\t\treturn [\n\t\t\t\"pagination\",\n\t\t\t\"rows\",\n\t\t\t\"rows-options\",\n\t\t\t\"striped\",\n\t\t\t\"hover\",\n\t\t\t\"toolbar\",\n\t\t\t\"empty-message\",\n\t\t\t\"pagination-position\",\n\t\t\t\"lazy\",\n\t\t\t\"total\",\n\t\t\t\"loading\",\n\t\t\t\"loading-message\",\n\t\t\t\"sort-field\",\n\t\t\t\"sort-order\",\n\t\t\t\"rounded\",\n\t\t\t\"radius\",\n\t\t\t\"no-borders-x\",\n\t\t];\n\t}\n\n\tprivate _data: Record<string, unknown>[] = [];\n\tprivate _total?: number;\n\tprivate page = 0;\n\tprivate sortField = \"\";\n\tprivate sortDir: 1 | -1 = 1;\n\tprivate filters: Record<string, string> = {};\n\tprivate globalSearch = \"\";\n\tprivate _columnObserver?: MutationObserver;\n\t/** Inputs da toolbar slotted já receberam listener (não recria a cada render). */\n\tprivate _boundToolbarInputs = new WeakSet<HTMLInputElement>();\n\n\tget data(): Record<string, unknown>[] {\n\t\treturn this._data;\n\t}\n\tset data(value: Record<string, unknown>[]) {\n\t\tthis._data = Array.isArray(value) ? value : [];\n\t\tthis.render();\n\t}\n\n\tget total(): number {\n\t\treturn this._total ?? this._data.length;\n\t}\n\tset total(value: number) {\n\t\tthis._total = value;\n\t\tthis.setAttribute(\"total\", String(value));\n\t}\n\n\tget rowsPerPage(): number {\n\t\tconst r = Number(this.getAttr(\"rows\", \"10\"));\n\t\treturn r > 0 ? r : 10;\n\t}\n\tset rowsPerPage(value: number) {\n\t\tthis.setAttribute(\"rows\", String(value));\n\t}\n\n\tget lazy(): boolean {\n\t\treturn this.hasAttr(\"lazy\");\n\t}\n\tset lazy(value: boolean) {\n\t\tthis.toggleAttr(\"lazy\", Boolean(value));\n\t}\n\n\tget pagination(): boolean {\n\t\treturn this.hasAttr(\"pagination\");\n\t}\n\tset pagination(value: boolean) {\n\t\tthis.toggleAttr(\"pagination\", Boolean(value));\n\t}\n\n\tget striped(): boolean {\n\t\treturn this.hasAttr(\"striped\");\n\t}\n\tset striped(value: boolean) {\n\t\tthis.toggleAttr(\"striped\", Boolean(value));\n\t}\n\n\tget hover(): boolean {\n\t\treturn this.hasAttr(\"hover\");\n\t}\n\tset hover(value: boolean) {\n\t\tthis.toggleAttr(\"hover\", Boolean(value));\n\t}\n\n\tget loading(): boolean {\n\t\treturn this.hasAttr(\"loading\");\n\t}\n\tset loading(value: boolean) {\n\t\tthis.toggleAttr(\"loading\", Boolean(value));\n\t}\n\n\t/**\n\t * Vue não cameliza atributos de elementos customizados:\n\t * `:no-borders-x=\"false\"` procura a propriedade LITERAL\n\t * `'no-borders-x'` — o accessor literal evita o contorno `.attr`.\n\t */\n\tget 'no-borders-x'(): boolean {\n\t\treturn this.hasAttr(\"no-borders-x\");\n\t}\n\tset 'no-borders-x'(value: boolean) {\n\t\tthis.toggleAttr(\"no-borders-x\", Boolean(value));\n\t}\n\n\tprivate get columns(): {\n\t\tfield: string;\n\t\theader: string;\n\t\tsortable: boolean;\n\t\tfilterable: boolean;\n\t\talign: string;\n\t\ttemplate?: HTMLElement;\n\t\tdirectTemplate?: string;\n\t}[] {\n\t\treturn [...this.querySelectorAll(\"fx-column\")].map((c) => {\n\t\t\tconst tpl = this._resolveCellTemplate(c);\n\t\t\tconst direct = tpl ? undefined : c.innerHTML.trim();\n\t\t\tconst align = c.getAttribute(\"align\") ?? \"left\";\n\t\t\treturn {\n\t\t\t\tfield: c.getAttribute(\"field\") ?? \"\",\n\t\t\t\theader: c.getAttribute(\"header\") ?? c.getAttribute(\"field\") ?? \"\",\n\t\t\t\tsortable: c.hasAttribute(\"sortable\"),\n\t\t\t\tfilterable: c.hasAttribute(\"filterable\"),\n\t\t\t\talign: [\"left\", \"center\", \"right\", \"justify\", \"start\", \"end\"].includes(align) ? align : \"left\",\n\t\t\t\ttemplate: tpl ?? undefined,\n\t\t\t\tdirectTemplate: direct || undefined,\n\t\t\t};\n\t\t});\n\t}\n\n\t/**\n\t * Resolve o template de célula de uma `<fx-column>`, em ordem de prioridade:\n\t *\n\t * 1. `<fx-cell>` — **recomendado**. Tag própria, sem significado especial\n\t * para Vue/React/Angular/Svelte: nenhum framework a intercepta, então o\n\t * `innerHTML` sempre chega intacto ao componente. O light DOM do\n\t * `<fx-table>` não é exibido (a tabela não usa `<slot>`), então o\n\t * conteúdo-fonte nunca aparece na tela.\n\t *\n\t * ⚠️ O conteúdo é TEXTO CRU para o motor de expressões: o `{{ }}` NÃO é\n\t * interpretado pelo framework hospedeiro. Cada um precisa neutralizar a\n\t * própria sintaxe antes (ver o cabeçalho do arquivo): `v-pre` no Vue,\n\t * `{'{{ }}'}` no JSX, `ngNonBindable` no Angular, string/entidades no\n\t * Svelte. Sem isso o template não chega ao `renderCell`.\n\t * 2. `template=\"#id\"` (ou `template=\"id\"`) — aponta para um `<template>`\n\t * declarado **fora** da tabela, útil em React/Angular, onde é mais\n\t * simples manter o markup num único lugar.\n\t * 3. `<template>` dentro da coluna — forma **legada**, mantida por\n\t * compatibilidade. Em Vue 3 ela vira um bloco do compilador e em React os\n\t * filhos são gerenciados pelo framework; nos dois casos o `innerHTML`\n\t * chega vazio e a célula não renderiza. Prefira `<fx-cell>`.\n\t */\n\tprivate _resolveCellTemplate(c: Element): HTMLElement | null {\n\t\tconst cell = c.querySelector<HTMLElement>(\":scope > fx-cell\");\n\t\tif (cell) return cell;\n\t\tconst ref = c.getAttribute(\"template\");\n\t\tif (ref) {\n\t\t\tconst alvo = this._resolveRef(ref);\n\t\t\tif (alvo) return alvo;\n\t\t}\n\t\treturn c.querySelector<HTMLElement>(\"template\");\n\t}\n\n\tprivate get toolbarTemplate(): HTMLElement | null {\n\t\t// Mesma lógica da célula: `<fx-toolbar>` > `toolbar=\"#id\"` > legado.\n\t\tconst bar = this.querySelector<HTMLElement>(\":scope > fx-toolbar\");\n\t\tif (bar) return bar;\n\t\tconst ref = this.getAttr(\"toolbar\");\n\t\tif (ref) {\n\t\t\tconst alvo = this._resolveRef(ref);\n\t\t\tif (alvo) return alvo;\n\t\t}\n\t\treturn this.querySelector<HTMLElement>('template[slot=\"toolbar\"]');\n\t}\n\n\t/**\n\t * Resolve `ref` para um elemento: `#id`/`id` ⇒ `getElementById` no\n\t * documento; qualquer outro valor é tratado como seletor CSS relativo à\n\t * própria tabela. Valores inválidos devolvem `null` (sem exceção).\n\t */\n\tprivate _resolveRef(ref: string): HTMLElement | null {\n\t\tconst valor = ref.trim();\n\t\tif (!valor) return null;\n\t\tconst doc = this.ownerDocument;\n\t\tif (valor.startsWith('#')) return doc?.getElementById(valor.slice(1)) ?? null;\n\t\tif (/^[.#[>]/.test(valor)) {\n\t\t\ttry {\n\t\t\t\treturn this.querySelector<HTMLElement>(valor);\n\t\t\t} catch {\n\t\t\t\treturn null; // seletor inválido — degrada para o próximo fallback\n\t\t\t}\n\t\t}\n\t\treturn doc?.getElementById(valor) ?? null;\n\t}\n\n\tprotected override connectedCallback(): void {\n\t\tthis._parseDataAttribute();\n\t\tthis._parseSortAttributes();\n\t\t// O pager usa glifos da Fenix Icons: garante o @font-face mesmo quando o\n\t\t// app não importou `@wrrdev/fenix-ui/icons` (idempotente).\n\t\tloadFenixIconsFont();\n\t\tsuper.connectedCallback();\n\t\tthis._columnObserver = new MutationObserver(() => this.render());\n\t\tthis._columnObserver.observe(this, {\n\t\t\tchildList: true,\n\t\t\tsubtree: true,\n\t\t\t// Colunas com header/field/align/sortable/filterable alterados\n\t\t\t// em runtime também precisam re-renderizar.\n\t\t\tattributes: true,\n\t\t\tattributeFilter: [\"header\", \"field\", \"align\", \"sortable\", \"filterable\", \"template\"],\n\t\t});\n\t}\n\n\tprotected override disconnectedCallback(): void {\n\t\tthis._columnObserver?.disconnect();\n\t\tsuper.disconnectedCallback();\n\t}\n\n\t/** Ordenação inicial via `sort-field` / `sort-order` (documentados na API). */\n\tprivate _parseSortAttributes(): void {\n\t\tconst field = this.getAttr(\"sort-field\");\n\t\tif (field) this.sortField = field;\n\t\tconst order = this.getAttr(\"sort-order\");\n\t\tif (order === \"asc\" || order === \"desc\") this.sortDir = order === \"asc\" ? 1 : -1;\n\t}\n\n\tprivate _parseDataAttribute(): void {\n\t\tif (!this._data.length) {\n\t\t\ttry {\n\t\t\t\tconst json = this.getAttr(\"data\");\n\t\t\t\tif (json) this._data = JSON.parse(json);\n\t\t\t} catch {\n\t\t\t\t/* atributo invalido - ignora */\n\t\t\t}\n\t\t}\n\t\tconst totalAttr = this.getAttr(\"total\");\n\t\tif (totalAttr) {\n\t\t\tconst n = Number(totalAttr);\n\t\t\tif (!isNaN(n)) this._total = n;\n\t\t}\n\t}\n\n\tprivate computeRows(): { rows: Record<string, unknown>[]; total: number } {\n\t\tlet out = [...this._data];\n\n\t\tfor (const [field, term] of Object.entries(this.filters)) {\n\t\t\tif (!term) continue;\n\t\t\tconst t = term.toLowerCase();\n\t\t\tout = out.filter((r) =>\n\t\t\t\tString(r[field] ?? \"\")\n\t\t\t\t\t.toLowerCase()\n\t\t\t\t\t.includes(t),\n\t\t\t);\n\t\t}\n\n\t\tif (this.globalSearch) {\n\t\t\tconst t = this.globalSearch.toLowerCase();\n\t\t\tconst searchFields = this._getSearchFields();\n\t\t\tout = out.filter((r) => {\n\t\t\t\tconst fields = searchFields.length ? searchFields : Object.keys(r);\n\t\t\t\treturn fields.some((f) =>\n\t\t\t\t\tString(r[f] ?? \"\")\n\t\t\t\t\t\t.toLowerCase()\n\t\t\t\t\t\t.includes(t),\n\t\t\t\t);\n\t\t\t});\n\t\t}\n\n\t\tconst total = this.lazy ? this.total : out.length;\n\n\t\tif (this.sortField) {\n\t\t\tout.sort((a, b) => {\n\t\t\t\tconst av = a[this.sortField],\n\t\t\t\t\tbv = b[this.sortField];\n\t\t\t\tif (typeof av === \"number\" && typeof bv === \"number\")\n\t\t\t\t\treturn (av - bv) * this.sortDir;\n\t\t\t\treturn (\n\t\t\t\t\tString(av ?? \"\").localeCompare(String(bv ?? \"\"), \"pt-BR\") *\n\t\t\t\t\tthis.sortDir\n\t\t\t\t);\n\t\t\t});\n\t\t}\n\n\t\tif (this.hasAttr(\"pagination\") && !this.lazy) {\n\t\t\tconst start = this.page * this.rowsPerPage;\n\t\t\tout = out.slice(start, start + this.rowsPerPage);\n\t\t}\n\n\t\treturn { rows: out, total };\n\t}\n\n\tprivate _getSearchFields(): string[] {\n\t\tconst input = this.root.querySelector<HTMLInputElement>(\n\t\t\t\"[data-search-fields]\",\n\t\t);\n\t\tif (!input) return [];\n\t\tconst attr = input.getAttribute(\"data-search-fields\");\n\t\tif (attr === null) return [];\n\t\treturn attr\n\t\t\t.split(\",\")\n\t\t\t.map((s) => s.trim())\n\t\t\t.filter(Boolean);\n\t}\n\n\tprivate cellHtml(\n\t\tcol: {\n\t\t\tfield: string;\n\t\t\ttemplate?: HTMLElement;\n\t\t\tdirectTemplate?: string;\n\t\t},\n\t\trow: Record<string, unknown>,\n\t): string {\n\t\tconst template = col.template?.innerHTML ?? col.directTemplate;\n\t\tif (template) return renderCell(template, row, col.field);\n\t\treturn esc(String(row[col.field] ?? \"\"));\n\t}\n\n\t/**\n\t * Assinatura da \"casca\" da tabela: tudo que NÃO depende das linhas\n\t * (colunas, toolbar, filtros, paginação, loading).\n\t *\n\t * Serve para o caminho rápido: quando só `data` muda, a casca é idêntica e\n\t * podemos trocar apenas o `<tbody>`, sem recriar `<style>`, `<thead>`,\n\t * toolbar e paginação — nem religar todos os listeners.\n\t */\n\tprivate _shellKey = '';\n\n\tprotected override render(): void {\n\t\tconst cols = this.columns.filter((c) => c.field);\n\t\tconst { rows, total } = this.computeRows();\n\t\tconst paginated = this.hasAttr(\"pagination\");\n\t\tconst pages = Math.max(1, Math.ceil(total / this.rowsPerPage));\n\t\tif (this.page >= pages) this.page = pages - 1;\n\n\t\tconst toolbar = this.toolbarTemplate;\n\t\t// <fx-toolbar> usa <slot>: os nós continuam no light DOM e os\n\t\t// listeners do framework (@click, v-model) sobrevivem. As formas\n\t\t// legadas (template/toolbar=\"#id\") seguem por clone de innerHTML.\n\t\tconst toolbarSlotted = toolbar?.localName === \"fx-toolbar\";\n\t\tconst toolbarHasContent = Boolean(\n\t\t\ttoolbar &&\n\t\t\t\t(toolbarSlotted\n\t\t\t\t\t? toolbar.children.length > 0 || (toolbar.textContent ?? \"\").trim() !== \"\"\n\t\t\t\t\t: toolbar.innerHTML.trim() !== \"\"),\n\t\t);\n\t\tif (toolbarSlotted && toolbarHasContent) {\n\t\t\ttoolbar.setAttribute(\"slot\", \"fx-toolbar\");\n\t\t}\n\t\tconst toolbarHtml = toolbarHasContent\n\t\t\t? `<div class=\"toolbar\" part=\"toolbar\">${\n\t\t\t\t\ttoolbarSlotted ? '<slot name=\"fx-toolbar\"></slot>' : toolbar!.innerHTML\n\t\t\t\t}</div>`\n\t\t\t: \"\";\n\n\t\tconst headHtml = cols\n\t\t\t.map((c) => {\n\t\t\t\tconst isSorted = this.sortField === c.field;\n\t\t\t\tconst ind = isSorted\n\t\t\t\t\t? this.sortDir === 1\n\t\t\t\t\t\t? \"▲\"\n\t\t\t\t\t\t: \"▼\"\n\t\t\t\t\t: c.sortable\n\t\t\t\t\t\t? \"⇅\"\n\t\t\t\t\t\t: \"\";\n\t\t\t\tconst activeClass = isSorted ? \"active\" : \"\";\n\t\t\t\treturn `<th part=\"header\" class=\"${c.sortable ? \"sortable\" : \"\"}\" style=\"text-align:${c.align}\" data-field=\"${esc(c.field)}\">${esc(c.header)}${ind ? `<span class=\"sort-ind ${activeClass}\">${ind}</span>` : \"\"}</th>`;\n\t\t\t})\n\t\t\t.join(\"\");\n\n\t\tconst filterRow = cols.some((c) => c.filterable)\n\t\t\t? `<tr class=\"filter-row\">${cols.map((c) => `<th style=\"text-align:${c.align}\">${c.filterable ? `<input class=\"filter\" data-field=\"${esc(c.field)}\" placeholder=\"${esc(\"Filtrar…\")}\" value=\"${esc(this.filters[c.field] ?? \"\")}\">` : \"\"}</th>`).join(\"\")}</tr>`\n\t\t\t: \"\";\n\n\t\tconst bodyHtml = rows.length\n\t\t\t? rows\n\t\t\t\t\t.map(\n\t\t\t\t\t\t(row, i) =>\n\t\t\t\t\t\t\t`<tr part=\"row\" data-index=\"${i}\">${cols.map((c) => `<td part=\"cell\" style=\"text-align:${c.align}\">${this.cellHtml(c, row)}</td>`).join(\"\")}</tr>`,\n\t\t\t\t\t)\n\t\t\t\t\t.join(\"\")\n\t\t\t: `<tr><td class=\"empty\" colspan=\"${cols.length || 1}\">${esc(this.getAttr(\"empty-message\", \"Nenhum registro encontrado\"))}</td></tr>`;\n\n\t// Janela de páginas: primeira + última + vizinhas da atual, com elipse no\n\t// miolo. Sem isso, com 1.000 páginas o rodapé renderizava 1.000 botões.\n\tconst pageButtons = pageRange(this.page + 1, pages)\n\t\t.map((item) =>\n\t\t\titem === \"ellipsis\"\n\t\t\t\t? `<span class=\"ellipsis\" part=\"ellipsis\" aria-hidden=\"true\">…</span>`\n\t\t\t\t: `<button type=\"button\" class=\"pg-btn\" part=\"page\" data-pg=\"${item - 1}\"${item === this.page + 1 ? ' aria-current=\"page\"' : \"\"}>${item}</button>`,\n\t\t)\n\t\t.join(\"\");\n\n\t\tconst pagerHtml = !paginated\n\t\t\t? \"\"\n\t\t\t: `\n <div class=\"pager\" part=\"pager\">\n <span class=\"info\">Página ${this.page + 1} de ${pages} · ${total} registros</span>\n <button type=\"button\" class=\"pg-btn\" part=\"first\" aria-label=\"Primeira página\" data-pg=\"first\" ${this.page === 0 ? \"disabled\" : \"\"}>${fenixIconHtml(\"first_page\")}</button>\n <button type=\"button\" class=\"pg-btn\" part=\"prev\" aria-label=\"Página anterior\" data-pg=\"prev\" ${this.page === 0 ? \"disabled\" : \"\"}>${fenixIconHtml(\"navigate_before\")}</button>\n ${pageButtons}\n <button type=\"button\" class=\"pg-btn\" part=\"next\" aria-label=\"Próxima página\" data-pg=\"next\" ${this.page >= pages - 1 ? \"disabled\" : \"\"}>${fenixIconHtml(\"navigate_next\")}</button>\n <button type=\"button\" class=\"pg-btn\" part=\"last\" aria-label=\"Última página\" data-pg=\"last\" ${this.page >= pages - 1 ? \"disabled\" : \"\"}>${fenixIconHtml(\"last_page\")}</button>\n <label class=\"info\">${esc(\"Por página:\")}\n <fx-select class=\"rows-sel\" size=\"sm\" placement=\"top\" value=\"${this.rowsPerPage}\" aria-label=\"Itens por página\">${this.getAttr(\n\t\t\t\t\t\"rows-options\",\n\t\t\t\t\t\"5,10,20,50\",\n\t\t\t\t)\n\t\t\t\t\t.split(\",\")\n\t\t\t\t\t.map((n) => n.trim())\n\t\t\t\t\t.map((n) => `<option value=\"${esc(n)}\">${esc(n)}</option>`)\n\t\t\t\t\t.join(\"\")}</fx-select>\n </label>\n </div>`;\n\n\t\tconst loading = this.hasAttr(\"loading\");\n\t\tconst loadingHtml = loading\n\t\t\t? `<div class=\"loading-overlay\" part=\"loading-overlay\"><div class=\"tbl-spinner\" part=\"spinner\"></div><span class=\"loading-text\">${esc(this.getAttr(\"loading-message\", \"Carregando…\"))}</span></div>`\n\t\t\t: \"\";\n\n\t\t// Caminho rápido: se a casca não mudou (só `data` foi substituído),\n\t\t// troca APENAS o <tbody>. Evita recriar <style>/<thead>/toolbar/pager e\n\t\t// religar todos os listeners a cada atribuição de `data` — que é o\n\t\t// gargalo em tabelas grandes (busca por tecla, paginação, reload).\n\t\tconst shellKey = [\n\t\t\ttoolbarHtml,\n\t\t\theadHtml,\n\t\t\tfilterRow,\n\t\t\tpagerHtml,\n\t\t\tloadingHtml,\n\t\t\tcols.length,\n\t\t].join(\"|\");\n\t\tif (shellKey === this._shellKey) {\n\t\t\tconst tbody = this.root.querySelector(\"tbody\");\n\t\t\tif (tbody) {\n\t\t\t\ttbody.innerHTML = bodyHtml;\n\t\t\t\tthis._bindRowClicks(rows);\n\t\t\t\t// A toolbar slotted vive no light DOM: mesmo no caminho rápido\n\t\t\t\t// pode ter recebido um input novo do framework.\n\t\t\t\tthis._bindSlottedToolbarSearch(toolbar);\n\t\t\t\tthis._restoreToolbarSearch();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tthis._shellKey = shellKey;\n\n\t\tthis.setTemplate(`\n ${toolbarHtml}\n <div class=\"frame${toolbarHasContent ? \" has-toolbar\" : \"\"}\" part=\"frame\">\n <div class=\"table-wrap\">\n <div class=\"scroll\">\n <table part=\"table\">\n <thead><tr>${headHtml}</tr>${filterRow}</thead>\n <tbody>${bodyHtml}</tbody>\n </table>\n </div>\n ${loadingHtml}\n </div>\n ${pagerHtml}\n </div>\n `);\n\n\t\t// Ordenação.\n\t\tthis.root\n\t\t\t.querySelectorAll<HTMLTableCellElement>(\"th.sortable\")\n\t\t\t.forEach((th) => {\n\t\t\t\tth.addEventListener(\"click\", () => {\n\t\t\t\t\tconst f = th.dataset.field!;\n\t\t\t\t\tif (this.sortField === f)\n\t\t\t\t\t\tthis.sortDir = this.sortDir === 1 ? -1 : 1;\n\t\t\t\t\telse {\n\t\t\t\t\t\tthis.sortField = f;\n\t\t\t\t\t\tthis.sortDir = 1;\n\t\t\t\t\t}\n\t\t\t\t\tthis.render();\n\t\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\t\tnew CustomEvent(\"sort-change\", {\n\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\t\tdetail: {\n\t\t\t\t\t\t\t\tfield: this.sortField,\n\t\t\t\t\t\t\t\tdirection: this.sortDir === 1 ? \"asc\" : \"desc\",\n\t\t\t\t\t\t\t\tlazy: this.lazy,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t\t});\n\n\t\t// Filtros (preserva foco/caret ao digitar).\n\t\tthis.root.querySelectorAll<HTMLInputElement>(\".filter\").forEach((inp) => {\n\t\t\tinp.addEventListener(\"input\", () => {\n\t\t\t\tconst field = inp.dataset.field!;\n\t\t\t\tconst value = inp.value;\n\t\t\t\tconst pos = inp.selectionStart;\n\t\t\t\tthis.filters[field] = value;\n\t\t\t\tthis.page = 0;\n\t\t\t\tthis.render();\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent(\"filter-change\", {\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\tdetail: { field, value, lazy: this.lazy },\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t\tconst again = this.root.querySelector<HTMLInputElement>(\n\t\t\t\t\t`.filter[data-field=\"${esc(field)}\"]`,\n\t\t\t\t);\n\t\t\t\tif (again) {\n\t\t\t\t\tagain.focus();\n\t\t\t\t\tagain.setSelectionRange(pos, pos);\n\t\t\t\t}\n\t\t\t});\n\t\t\tinp.addEventListener(\"click\", (e) => e.stopPropagation());\n\t\t});\n\n\t\t// Busca global da toolbar (clone no shadow + inputs slotted persistentes).\n\t\tthis.root\n\t\t\t.querySelectorAll<HTMLInputElement>(\"[data-search-fields]\")\n\t\t\t.forEach((inp) => this._bindSearchInput(inp, false));\n\t\tif (toolbarSlotted && toolbar) {\n\t\t\tthis._bindSlottedToolbarSearch(toolbar);\n\t\t}\n\n\t\t// Paginação.\n\t\tthis.root\n\t\t\t.querySelectorAll<HTMLButtonElement>(\".pg-btn\")\n\t\t\t.forEach((btn) => {\n\t\t\t\tbtn.addEventListener(\"click\", () => {\n\t\t\t\t\tconst pg = btn.dataset.pg!;\n\t\t\t\t\tthis.page =\n\t\t\t\t\t\tpg === \"first\"\n\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t: pg === \"prev\"\n\t\t\t\t\t\t\t\t? Math.max(0, this.page - 1)\n\t\t\t\t\t\t\t\t: pg === \"next\"\n\t\t\t\t\t\t\t\t\t? Math.min(pages - 1, this.page + 1)\n\t\t\t\t\t\t\t\t\t: pg === \"last\"\n\t\t\t\t\t\t\t\t\t\t? pages - 1\n\t\t\t\t\t\t\t\t\t\t: Number(pg);\n\t\t\t\t\tthis.render();\n\t\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\t\tnew CustomEvent(\"page-change\", {\n\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\t\tdetail: {\n\t\t\t\t\t\t\t\tpage: this.page + 1,\n\t\t\t\t\t\t\t\tpages,\n\t\t\t\t\t\t\t\trowsPerPage: this.rowsPerPage,\n\t\t\t\t\t\t\t\ttotal,\n\t\t\t\t\t\t\t\tlazy: this.lazy,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t\t});\n\t\tthis.root\n\t\t\t.querySelector<HTMLElement>(\"fx-select.rows-sel\")\n\t\t\t?.addEventListener(\"change\", (e) => {\n\t\t\t\tconst value = Number((e as CustomEvent).detail?.value);\n\t\t\t\tif (!value || value === this.rowsPerPage) return;\n\t\t\t\tthis.rowsPerPage = value;\n\t\t\t\tthis.page = 0;\n\t\t\t\tthis.render();\n\t\t\t});\n\n\t\t// Clique na linha.\n\t\tthis._bindRowClicks(rows);\n\n\t\tthis._restoreToolbarSearch();\n\t}\n\n\t/**\n\t * Liga o clique das linhas ao evento `row-click`.\n\t *\n\t * Extraído do render para ser reaproveitado no caminho rápido (troca só do\n\t * <tbody>): os <tr> são novos, então precisam ser rebound.\n\t */\n\tprivate _bindRowClicks(rows: Record<string, unknown>[]): void {\n\t\tthis.root\n\t\t\t.querySelectorAll<HTMLTableRowElement>(\"tbody tr[data-index]\")\n\t\t\t.forEach((tr) => {\n\t\t\t\ttr.addEventListener(\"click\", () => {\n\t\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\t\tnew CustomEvent(\"row-click\", {\n\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\t\tdetail: {\n\t\t\t\t\t\t\t\trow: rows[Number(tr.dataset.index)],\n\t\t\t\t\t\t\t\tindex: Number(tr.dataset.index),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t\t});\n\t}\n\n\t/** Liga (uma vez) os inputs de busca de um <fx-toolbar> slotted. */\n\tprivate _bindSlottedToolbarSearch(toolbar: HTMLElement | null): void {\n\t\tif (!toolbar || toolbar.localName !== \"fx-toolbar\") return;\n\t\ttoolbar\n\t\t\t.querySelectorAll<HTMLInputElement>(\"[data-search-fields]\")\n\t\t\t.forEach((inp) => {\n\t\t\t\tif (this._boundToolbarInputs.has(inp)) return;\n\t\t\t\tthis._boundToolbarInputs.add(inp);\n\t\t\t\tthis._bindSearchInput(inp, true);\n\t\t\t});\n\t}\n\n\t/**\n\t * Liga um input da toolbar à busca global.\n\t * `persistent` = input slotted (não é recriado pelo render): o foco volta\n\t * no próprio nó. Inputs clonados são substituídos, então o foco é\n\t * restaurado no clone novo do shadow.\n\t */\n\tprivate _bindSearchInput(inp: HTMLInputElement, persistent: boolean): void {\n\t\tinp.addEventListener(\"input\", () => {\n\t\t\tthis.globalSearch = inp.value;\n\t\t\tthis.page = 0;\n\t\t\tconst pos = inp.selectionStart;\n\t\t\tthis.render();\n\t\t\tconst again = persistent && inp.isConnected\n\t\t\t\t? inp\n\t\t\t\t: this.root.querySelector<HTMLInputElement>(\"[data-search-fields]\");\n\t\t\tif (again) {\n\t\t\t\tagain.focus();\n\t\t\t\tagain.setSelectionRange(pos, pos);\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate _restoreToolbarSearch(): void {\n\t\tconst shadow = this.root.querySelector<HTMLInputElement>(\n\t\t\t\"[data-search-fields]\",\n\t\t);\n\t\tif (shadow && this.globalSearch) shadow.value = this.globalSearch;\n\n\t\tconst toolbar = this.toolbarTemplate;\n\t\tif (toolbar?.localName === \"fx-toolbar\") {\n\t\t\ttoolbar\n\t\t\t\t.querySelectorAll<HTMLInputElement>(\"[data-search-fields]\")\n\t\t\t\t.forEach((input) => {\n\t\t\t\t\tif (this.globalSearch && input.value !== this.globalSearch) {\n\t\t\t\t\t\tinput.value = this.globalSearch;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t}\n\t}\n}\n\nexport function defineFxTable(): typeof FxTable {\n return defineElement('fx-table', FxTable);\n}\n"],"names":[],"mappings":";;;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A;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAFhB,IAAM,UAAN;AA47BA,SAAS,gBAAgC;AAC9C,SAAO,cAAc,YAAY,OAAO;AAC1C;"}
|
|
@@ -17,6 +17,12 @@ export declare class FxTabs extends FxElement {
|
|
|
17
17
|
static get observedAttributes(): string[];
|
|
18
18
|
get value(): string;
|
|
19
19
|
set value(value: string);
|
|
20
|
+
/** Observa abas/painéis criados por v-if/v-for depois do primeiro render. */
|
|
21
|
+
private _lightObserver?;
|
|
22
|
+
private _siblingObserver?;
|
|
23
|
+
protected connectedCallback(): void;
|
|
24
|
+
protected disconnectedCallback(): void;
|
|
25
|
+
private _observeLightDom;
|
|
20
26
|
protected render(): void;
|
|
21
27
|
/** Painéis associados: descendentes do host ou irmãos seguintes no DOM. */
|
|
22
28
|
private get panels();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../src/components/tabs/tabs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAK5C;;;;;;;;;;;;GAYG;AACH,qBAAa,MAAO,SAAQ,SAAS;IACnC,OAAgB,MAAM,SAmDpB;IAEF,WAAoB,kBAAkB,IAAI,MAAM,EAAE,CAEjD;IAED,IAAI,KAAK,IAAI,MAAM,CAAkC;IACrD,IAAI,KAAK,CAAC,KAAK,EAAE,MAAM,EAAwC;
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../src/components/tabs/tabs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAK5C;;;;;;;;;;;;GAYG;AACH,qBAAa,MAAO,SAAQ,SAAS;IACnC,OAAgB,MAAM,SAmDpB;IAEF,WAAoB,kBAAkB,IAAI,MAAM,EAAE,CAEjD;IAED,IAAI,KAAK,IAAI,MAAM,CAAkC;IACrD,IAAI,KAAK,CAAC,KAAK,EAAE,MAAM,EAAwC;IAE/D,6EAA6E;IAC7E,OAAO,CAAC,cAAc,CAAC,CAAmB;IAC1C,OAAO,CAAC,gBAAgB,CAAC,CAAmB;cAEzB,iBAAiB,IAAI,IAAI;cAKzB,oBAAoB,IAAI,IAAI;IAQ/C,OAAO,CAAC,gBAAgB;cAgCL,MAAM,IAAI,IAAI;IAwCjC,2EAA2E;IAC3E,OAAO,KAAK,MAAM,GAWjB;CACF;AAED;;GAEG;AACH,qBAAa,UAAW,SAAQ,SAAS;IACvC,OAAgB,MAAM,SAGpB;IAEF,WAAoB,kBAAkB,IAAI,MAAM,EAAE,CAEjD;IAED,IAAI,GAAG,IAAI,MAAM,CAAgC;IACjD;;+CAE2C;IAC3C,IAAI,GAAG,CAAC,KAAK,EAAE,MAAM,EAAsC;IAE3D,IAAI,OAAO,IAAI,OAAO,CAAoC;IAC1D,IAAI,OAAO,CAAC,KAAK,EAAE,OAAO,EAAwC;cAE/C,MAAM,IAAI,IAAI;IAqBjC,OAAO,CAAC,YAAY,CAAS;CAC9B;AAED,wBAAgB,YAAY,IAAI,OAAO,MAAM,CAE5C;AACD,wBAAgB,gBAAgB,IAAI,OAAO,UAAU,CAEpD"}
|
|
@@ -12,6 +12,40 @@ const _FxTabs = class _FxTabs extends FxElement {
|
|
|
12
12
|
set value(value) {
|
|
13
13
|
this.setAttribute("value", value);
|
|
14
14
|
}
|
|
15
|
+
connectedCallback() {
|
|
16
|
+
super.connectedCallback();
|
|
17
|
+
this._observeLightDom();
|
|
18
|
+
}
|
|
19
|
+
disconnectedCallback() {
|
|
20
|
+
super.disconnectedCallback();
|
|
21
|
+
this._lightObserver?.disconnect();
|
|
22
|
+
this._siblingObserver?.disconnect();
|
|
23
|
+
this._lightObserver = void 0;
|
|
24
|
+
this._siblingObserver = void 0;
|
|
25
|
+
}
|
|
26
|
+
_observeLightDom() {
|
|
27
|
+
this._lightObserver?.disconnect();
|
|
28
|
+
this._lightObserver = new MutationObserver(() => this.render());
|
|
29
|
+
this._lightObserver.observe(this, {
|
|
30
|
+
childList: true,
|
|
31
|
+
subtree: true,
|
|
32
|
+
attributes: true,
|
|
33
|
+
attributeFilter: ["tab", "disabled"]
|
|
34
|
+
});
|
|
35
|
+
this._siblingObserver?.disconnect();
|
|
36
|
+
const parent = this.parentNode;
|
|
37
|
+
if (parent) {
|
|
38
|
+
this._siblingObserver = new MutationObserver((mutations) => {
|
|
39
|
+
const affectsPanels = mutations.some(
|
|
40
|
+
(m) => [...m.addedNodes, ...m.removedNodes].some(
|
|
41
|
+
(node) => node.nodeType === Node.ELEMENT_NODE && (node.matches("fx-tab-panel") || Boolean(node.querySelector("fx-tab-panel")))
|
|
42
|
+
)
|
|
43
|
+
);
|
|
44
|
+
if (affectsPanels) this.render();
|
|
45
|
+
});
|
|
46
|
+
this._siblingObserver.observe(parent, { childList: true });
|
|
47
|
+
}
|
|
48
|
+
}
|
|
15
49
|
render() {
|
|
16
50
|
const tabs = Array.from(this.querySelectorAll("fx-tab"));
|
|
17
51
|
const active = this.value || tabs[0]?.getAttribute("tab") || "";
|