@sankhyalabs/sankhyablocks 4.4.0-hotfix-ga-SKA-99999.1 → 4.5.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/dist/cjs/{ConfigStorage-05b9b162.js → ConfigStorage-bc7d1d9b.js} +1 -1
- package/dist/cjs/{DataFetcher-451b3e68.js → DataFetcher-6acfc3a8.js} +3 -3
- package/dist/cjs/{SnkFormConfigManager-18ed80a5.js → SnkFormConfigManager-5230e010.js} +2 -2
- package/dist/cjs/{SnkMessageBuilder-0a6f6459.js → SnkMessageBuilder-d147f088.js} +8 -1
- package/dist/cjs/{constants-3d09ebea.js → constants-73803daf.js} +5 -0
- package/dist/cjs/{form-config-fetcher-a93d6334.js → form-config-fetcher-4a952a50.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-application.cjs.entry.js +4 -4
- package/dist/cjs/snk-config-options.cjs.entry.js +1 -1
- package/dist/cjs/snk-configurator.cjs.entry.js +1 -1
- package/dist/cjs/snk-crud.cjs.entry.js +2 -2
- package/dist/cjs/snk-data-exporter.cjs.entry.js +4 -4
- package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
- package/dist/cjs/snk-detail-view.cjs.entry.js +6 -6
- package/dist/cjs/snk-field-config.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-bar.cjs.entry.js +3 -3
- package/dist/cjs/snk-filter-field-search.cjs.entry.js +185 -0
- package/dist/cjs/snk-form-config.cjs.entry.js +3 -3
- package/dist/cjs/snk-form.cjs.entry.js +4 -4
- package/dist/cjs/snk-grid-config.cjs.entry.js +4 -4
- package/dist/cjs/snk-grid.cjs.entry.js +3 -3
- package/dist/cjs/{snk-guides-viewer-618e5c1d.js → snk-guides-viewer-5d3dca5d.js} +3 -3
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +6 -6
- package/dist/cjs/snk-select-box.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-crud.cjs.entry.js +252 -0
- package/dist/cjs/snk-tab-config.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/snk-filter-field-search/interfaces/index.js +5 -0
- package/dist/collection/components/snk-filter-field-search/snk-filter-field-search.css +41 -0
- package/dist/collection/components/snk-filter-field-search/snk-filter-field-search.js +297 -0
- package/dist/collection/components/snk-filter-field-search/subcomponents/index.js +1 -0
- package/dist/collection/components/snk-filter-field-search/subcomponents/list-item.js +24 -0
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.css +27 -0
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +343 -0
- package/dist/collection/lib/dataUnit/InMemoryLoader.js +112 -0
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +3 -3
- package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/index.js +1 -1
- package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/personalized-reports-fetcher.js +1 -1
- package/dist/collection/lib/message/SnkMessageBuilder.js +3 -1
- package/dist/collection/lib/message/resources/snk-filter-field-search.msg.js +5 -0
- package/dist/collection/lib/utils/constants.js +5 -0
- package/dist/components/DataFetcher.js +3 -3
- package/dist/components/SnkMessageBuilder.js +8 -1
- package/dist/components/constants.js +6 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +2 -0
- package/dist/components/snk-data-exporter2.js +2 -2
- package/dist/components/snk-detail-view2.js +2 -1
- package/dist/components/snk-filter-field-search.d.ts +11 -0
- package/dist/components/snk-filter-field-search.js +205 -0
- package/dist/components/snk-grid2.js +2 -47
- package/dist/components/snk-simple-crud.d.ts +11 -0
- package/dist/components/snk-simple-crud.js +297 -0
- package/dist/components/taskbar-processor.js +47 -0
- package/dist/esm/{ConfigStorage-34caac5c.js → ConfigStorage-1b64cd96.js} +1 -1
- package/dist/esm/{DataFetcher-00309101.js → DataFetcher-5e99fa75.js} +3 -3
- package/dist/esm/{SnkFormConfigManager-d3a8aaf4.js → SnkFormConfigManager-0d9752c3.js} +2 -2
- package/dist/esm/{SnkMessageBuilder-9473ae03.js → SnkMessageBuilder-0e1ffd61.js} +8 -1
- package/dist/esm/{constants-fb9721cc.js → constants-9560e54f.js} +6 -1
- package/dist/esm/{form-config-fetcher-e58fc104.js → form-config-fetcher-677f86dd.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-application.entry.js +4 -4
- package/dist/esm/snk-config-options.entry.js +1 -1
- package/dist/esm/snk-configurator.entry.js +1 -1
- package/dist/esm/snk-crud.entry.js +2 -2
- package/dist/esm/snk-data-exporter.entry.js +4 -4
- package/dist/esm/snk-data-unit.entry.js +2 -2
- package/dist/esm/snk-detail-view.entry.js +6 -6
- package/dist/esm/snk-field-config.entry.js +1 -1
- package/dist/esm/snk-filter-bar.entry.js +3 -3
- package/dist/esm/snk-filter-field-search.entry.js +181 -0
- package/dist/esm/snk-form-config.entry.js +3 -3
- package/dist/esm/snk-form.entry.js +4 -4
- package/dist/esm/snk-grid-config.entry.js +4 -4
- package/dist/esm/snk-grid.entry.js +3 -3
- package/dist/esm/{snk-guides-viewer-7c32399d.js → snk-guides-viewer-6bb54367.js} +3 -3
- package/dist/esm/snk-guides-viewer.entry.js +6 -6
- package/dist/esm/snk-select-box.entry.js +1 -1
- package/dist/esm/snk-simple-crud.entry.js +248 -0
- package/dist/esm/snk-tab-config.entry.js +1 -1
- package/dist/sankhyablocks/{p-9cff8df2.js → p-0c11c980.js} +1 -1
- package/dist/sankhyablocks/{p-52989652.entry.js → p-268ab84f.entry.js} +1 -1
- package/dist/sankhyablocks/{p-0fe01a57.entry.js → p-2a3996b0.entry.js} +1 -1
- package/dist/sankhyablocks/p-330813ff.entry.js +1 -0
- package/dist/sankhyablocks/{p-25341d65.js → p-3c4823fc.js} +1 -1
- package/dist/sankhyablocks/{p-44c23eb1.entry.js → p-4bd183ba.entry.js} +1 -1
- package/dist/sankhyablocks/{p-c4483cb2.js → p-5518d572.js} +1 -1
- package/dist/sankhyablocks/{p-e0416591.entry.js → p-7889d481.entry.js} +1 -1
- package/dist/sankhyablocks/p-79d22df0.entry.js +1 -0
- package/dist/sankhyablocks/{p-fc86a31e.entry.js → p-869d6616.entry.js} +1 -1
- package/dist/sankhyablocks/{p-99742169.entry.js → p-86efa17d.entry.js} +1 -1
- package/dist/sankhyablocks/{p-2980936b.entry.js → p-8b0e8deb.entry.js} +1 -1
- package/dist/sankhyablocks/{p-ca72cc38.js → p-9bf0319f.js} +1 -1
- package/dist/sankhyablocks/{p-83ddac9f.entry.js → p-9f00c061.entry.js} +1 -1
- package/dist/sankhyablocks/{p-43d8d388.entry.js → p-9f2306ba.entry.js} +1 -1
- package/dist/sankhyablocks/{p-9d4a25d2.js → p-9f98fc3c.js} +1 -1
- package/dist/sankhyablocks/{p-840494aa.entry.js → p-a056d61f.entry.js} +1 -1
- package/dist/sankhyablocks/{p-70037212.js → p-a6258eed.js} +1 -1
- package/dist/sankhyablocks/{p-de1ee26c.entry.js → p-b318cec6.entry.js} +1 -1
- package/dist/sankhyablocks/p-c0bfafcb.entry.js +1 -0
- package/dist/sankhyablocks/p-cf9d1b55.entry.js +1 -0
- package/dist/sankhyablocks/{p-8899a7ea.entry.js → p-d3199c18.entry.js} +1 -1
- package/dist/sankhyablocks/{p-9d62bbca.entry.js → p-dbeac5db.entry.js} +1 -1
- package/dist/sankhyablocks/{p-f5d3ecb3.js → p-ecbfbb4a.js} +1 -1
- package/dist/sankhyablocks/{p-6e6ef989.entry.js → p-f83e3219.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-filter-field-search/interfaces/index.d.ts +35 -0
- package/dist/types/components/snk-filter-field-search/snk-filter-field-search.d.ts +58 -0
- package/dist/types/components/snk-filter-field-search/subcomponents/index.d.ts +1 -0
- package/dist/types/components/snk-filter-field-search/subcomponents/list-item.d.ts +2 -0
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +41 -0
- package/dist/types/components.d.ts +81 -2
- package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +21 -0
- package/dist/types/lib/message/resources/snk-filter-field-search.msg.d.ts +1 -0
- package/dist/types/lib/utils/constants.d.ts +4 -0
- package/package.json +2 -2
- package/react/components.d.ts +2 -0
- package/react/components.js +2 -0
- package/react/components.js.map +1 -1
- package/dist/sankhyablocks/p-4de78929.entry.js +0 -1
- package/dist/sankhyablocks/p-e7cc6e62.entry.js +0 -1
@@ -0,0 +1,297 @@
|
|
1
|
+
import { h } from "@stencil/core";
|
2
|
+
import { SelectedItemType } from "./interfaces";
|
3
|
+
import { ApplicationContext, ElementIDUtils, JSUtils } from "@sankhyalabs/core";
|
4
|
+
import { ListItem } from "./subcomponents";
|
5
|
+
const SNK_CONTEXT_KEY = "__SNK__APPLICATION__";
|
6
|
+
export class SnkFilterFieldSearch {
|
7
|
+
constructor() {
|
8
|
+
this._filterMetadataStorage = new Map();
|
9
|
+
this._dataSource = null;
|
10
|
+
this._filterText = "";
|
11
|
+
this._isLoading = false;
|
12
|
+
this.searchable = true;
|
13
|
+
this.breadcrumbItems = [];
|
14
|
+
this.linkItems = [];
|
15
|
+
this.fieldItems = [];
|
16
|
+
}
|
17
|
+
/**
|
18
|
+
* Define a fonte de dados do componente.
|
19
|
+
* @param {IFilterLink} currentLink - Link atual da entidade.
|
20
|
+
* @param {IFilterMetadata} fetchData - callback que executa a busca de dados.
|
21
|
+
* @throws {Error} - Quando os metadados não forem válidos.
|
22
|
+
* @throws {Error} - Quando o link atual não for do tipo link.
|
23
|
+
*/
|
24
|
+
async setDataSource(currentLink, fetchData) {
|
25
|
+
var _a;
|
26
|
+
this._isLoading = true;
|
27
|
+
let metadata = this._filterMetadataStorage.get(currentLink.uri);
|
28
|
+
if (!metadata) {
|
29
|
+
metadata = await fetchData(currentLink);
|
30
|
+
this._filterMetadataStorage.set(currentLink.uri, metadata);
|
31
|
+
}
|
32
|
+
const { fields, links } = metadata || {};
|
33
|
+
if (!Array.isArray(fields) || !Array.isArray(links))
|
34
|
+
throw new Error('Invalid metadata');
|
35
|
+
if (currentLink.type !== SelectedItemType.LINK)
|
36
|
+
throw new Error('The current link must be a link type');
|
37
|
+
this._dataSource = metadata;
|
38
|
+
this._currentLink = currentLink;
|
39
|
+
this.mapDataSourceToLinkItems();
|
40
|
+
this.mapDataSourceToFieldItems();
|
41
|
+
this._isLoading = false;
|
42
|
+
(_a = this._ezPopover) === null || _a === void 0 ? void 0 : _a.show();
|
43
|
+
this._ezFieldList.scrollToTop();
|
44
|
+
this._ezLinkList.scrollToTop();
|
45
|
+
}
|
46
|
+
/**
|
47
|
+
* Filtra a fonte de dados do componente.
|
48
|
+
* @param {string} filterText - Texto para filtrar a fonte de dados.
|
49
|
+
* @throws {Error} - Quando o componente estiver com a propriedade searchable como true.
|
50
|
+
*/
|
51
|
+
async filterDataSource(filterText) {
|
52
|
+
if (this.searchable)
|
53
|
+
throw new Error('This method is not available when searchable is true');
|
54
|
+
this.handleFilterChange(filterText);
|
55
|
+
}
|
56
|
+
mapDataSourceToLinkItems() {
|
57
|
+
var _a;
|
58
|
+
const { links } = this._dataSource;
|
59
|
+
const filterLinkLabelMessage = this.getMessage('snkFilterFieldSearch.linkLabel', { link: (_a = this._currentLink) === null || _a === void 0 ? void 0 : _a.description });
|
60
|
+
const items = links.map(link => (Object.assign({ label: link.description }, link)));
|
61
|
+
this.linkItems = [{
|
62
|
+
group: filterLinkLabelMessage,
|
63
|
+
items
|
64
|
+
}];
|
65
|
+
if (this.breadcrumbItems.length === 0) {
|
66
|
+
this.breadcrumbItems = [Object.assign({ id: JSUtils.generateUUID(), label: this._currentLink.description }, this._currentLink)];
|
67
|
+
}
|
68
|
+
}
|
69
|
+
mapDataSourceToFieldItems() {
|
70
|
+
var _a;
|
71
|
+
const { fields } = this._dataSource;
|
72
|
+
const filterFieldLabelMessage = this.getMessage('snkFilterFieldSearch.fieldLabel', { link: (_a = this._currentLink) === null || _a === void 0 ? void 0 : _a.description });
|
73
|
+
const filteredFields = fields.filter(field => {
|
74
|
+
if (!this._currentLink)
|
75
|
+
return true;
|
76
|
+
const searchableByDescription = field.description.toLowerCase().includes(this._filterText.toLowerCase());
|
77
|
+
const searchableByName = field.name.toLowerCase().includes(this._filterText.toLowerCase());
|
78
|
+
return searchableByDescription || searchableByName;
|
79
|
+
});
|
80
|
+
const items = filteredFields.map(field => (Object.assign({ label: field.description }, field)));
|
81
|
+
this.fieldItems = [{
|
82
|
+
group: filterFieldLabelMessage,
|
83
|
+
items
|
84
|
+
}];
|
85
|
+
}
|
86
|
+
handleFilterChange(filterText) {
|
87
|
+
if (this._isLoading)
|
88
|
+
return;
|
89
|
+
this._filterText = filterText;
|
90
|
+
this.mapDataSourceToFieldItems();
|
91
|
+
}
|
92
|
+
handleSelectLink({ detail: item }) {
|
93
|
+
if (this._isLoading)
|
94
|
+
return;
|
95
|
+
const breadcrumbByIndex = this.breadcrumbItems.findIndex(breadcrumbItem => breadcrumbItem.id === item.id);
|
96
|
+
item.cache = this._filterMetadataStorage.has(item.uri);
|
97
|
+
if (breadcrumbByIndex > -1) {
|
98
|
+
this.breadcrumbItems = this.breadcrumbItems.slice(0, (breadcrumbByIndex + 1));
|
99
|
+
}
|
100
|
+
else {
|
101
|
+
this.breadcrumbItems = [...this.breadcrumbItems, Object.assign({ id: JSUtils.generateUUID(), label: item.description }, item)];
|
102
|
+
}
|
103
|
+
this.ezSelectFilterItem.emit(Object.assign(Object.assign({}, item), { type: SelectedItemType.LINK }));
|
104
|
+
}
|
105
|
+
handleSelectField({ detail: item }) {
|
106
|
+
var _a;
|
107
|
+
const breadcrumbPath = this.breadcrumbItems.map(breadcrumbItem => breadcrumbItem.label).join('>>');
|
108
|
+
const selectedField = Object.assign(Object.assign({}, item), { type: SelectedItemType.FIELD, path: `${breadcrumbPath} >> ${item.description}` });
|
109
|
+
this.ezSelectFilterItem.emit(selectedField);
|
110
|
+
(_a = this._ezPopover) === null || _a === void 0 ? void 0 : _a.hide();
|
111
|
+
}
|
112
|
+
getElementID(sufix) {
|
113
|
+
return {
|
114
|
+
[ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: ElementIDUtils.getInternalIDInfo(sufix)
|
115
|
+
};
|
116
|
+
}
|
117
|
+
/**
|
118
|
+
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
119
|
+
* através de um pequeno modulo na estrutura da aplicação:
|
120
|
+
* - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
|
121
|
+
* Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-filter-field-search.msg.ts"
|
122
|
+
*/
|
123
|
+
getMessage(key, params) {
|
124
|
+
var _a, _b, _c;
|
125
|
+
if (!this._application)
|
126
|
+
this._application = ApplicationContext.getContextValue(SNK_CONTEXT_KEY);
|
127
|
+
return (_c = (_b = (_a = this._application) === null || _a === void 0 ? void 0 : _a.messagesBuilder) === null || _b === void 0 ? void 0 : _b.getMessage) === null || _c === void 0 ? void 0 : _c.call(_b, key, params);
|
128
|
+
}
|
129
|
+
;
|
130
|
+
componentWillLoad() {
|
131
|
+
this._application = ApplicationContext.getContextValue(SNK_CONTEXT_KEY);
|
132
|
+
}
|
133
|
+
componentDidLoad() {
|
134
|
+
ElementIDUtils.addIDInfoIfNotExists(this._ezPopover, 'popover');
|
135
|
+
}
|
136
|
+
disconnectedCallback() {
|
137
|
+
var _a;
|
138
|
+
this._filterMetadataStorage.clear();
|
139
|
+
(_a = this._ezPopover) === null || _a === void 0 ? void 0 : _a.hide();
|
140
|
+
}
|
141
|
+
render() {
|
142
|
+
var _a;
|
143
|
+
const searchLabelMessage = this.getMessage('snkFilterFieldSearch.searchLabel');
|
144
|
+
return (h("ez-popover", Object.assign({ ref: (el) => this._ezPopover = el, role: "dialog", "aria-hidden": !((_a = this._ezPopover) === null || _a === void 0 ? void 0 : _a.opened) }, this.getElementID('EzPopover')), h("div", { class: "snk-filter-field-search__container" }, h("header", { class: "snk-filter-field-search__header" }, this.searchable && !!searchLabelMessage && (h("ez-filter-input", Object.assign({ class: "snk-filter-field-search__input", label: searchLabelMessage, asyncSearch: true, canShowError: false, onEzSearching: (event) => this.handleFilterChange.bind(this)(event.detail), "aria-label": searchLabelMessage, "aria-required": "false", "aria-invalid": "false" }, this.getElementID('EzFilterInput')))), this.breadcrumbItems.length > 0 && (h("ez-breadcrumb", Object.assign({ items: this.breadcrumbItems, onSelectedItem: this.handleSelectLink.bind(this), role: "navigation", "aria-current": "step" }, this.getElementID('EzBreadcrumb')))), h("hr", { class: "ez-divider-horizontal ez-margin-vertical--medium" })), h("section", { class: "snk-filter-field-search__section" }, h("ez-list", Object.assign({ ref: (el) => this._ezLinkList = el, class: "snk-filter-field-search__list", id: "filterLinkList", useGroups: true, dataSource: this.linkItems, onEzSelectItem: this.handleSelectLink.bind(this), hoverFeedback: true, ezSelectable: true, itemSlotBuilder: ({ fieldCount }) => h("ez-badge", { label: fieldCount }), "aria-describedby": "filterLinkLabel" }, this.getElementID('EzListLinks'))), h("ez-list", Object.assign({ ref: (el) => this._ezFieldList = el, class: "snk-filter-field-search__list", id: "filterFieldList", useGroups: true, dataSource: this.fieldItems, onEzSelectItem: this.handleSelectField.bind(this), hoverFeedback: true, ezSelectable: true, itemSlotBuilder: ListItem, "aria-describedby": "filterFieldLabel" }, this.getElementID('EzListFields')))))));
|
145
|
+
}
|
146
|
+
static get is() { return "snk-filter-field-search"; }
|
147
|
+
static get encapsulation() { return "scoped"; }
|
148
|
+
static get originalStyleUrls() {
|
149
|
+
return {
|
150
|
+
"$": ["snk-filter-field-search.css"]
|
151
|
+
};
|
152
|
+
}
|
153
|
+
static get styleUrls() {
|
154
|
+
return {
|
155
|
+
"$": ["snk-filter-field-search.css"]
|
156
|
+
};
|
157
|
+
}
|
158
|
+
static get properties() {
|
159
|
+
return {
|
160
|
+
"searchable": {
|
161
|
+
"type": "boolean",
|
162
|
+
"mutable": false,
|
163
|
+
"complexType": {
|
164
|
+
"original": "boolean",
|
165
|
+
"resolved": "boolean",
|
166
|
+
"references": {}
|
167
|
+
},
|
168
|
+
"required": false,
|
169
|
+
"optional": false,
|
170
|
+
"docs": {
|
171
|
+
"tags": [],
|
172
|
+
"text": "Define se o componente ir\u00E1 possuir um campo de pesquisa."
|
173
|
+
},
|
174
|
+
"attribute": "searchable",
|
175
|
+
"reflect": false,
|
176
|
+
"defaultValue": "true"
|
177
|
+
}
|
178
|
+
};
|
179
|
+
}
|
180
|
+
static get states() {
|
181
|
+
return {
|
182
|
+
"breadcrumbItems": {},
|
183
|
+
"linkItems": {},
|
184
|
+
"fieldItems": {}
|
185
|
+
};
|
186
|
+
}
|
187
|
+
static get events() {
|
188
|
+
return [{
|
189
|
+
"method": "ezSelectFilterItem",
|
190
|
+
"name": "ezSelectFilterItem",
|
191
|
+
"bubbles": true,
|
192
|
+
"cancelable": true,
|
193
|
+
"composed": true,
|
194
|
+
"docs": {
|
195
|
+
"tags": [{
|
196
|
+
"name": "type",
|
197
|
+
"text": "{EventEmitter<IFilterField | IFilterLink>}"
|
198
|
+
}],
|
199
|
+
"text": "Emitido sempre que um item da lista for selecionado"
|
200
|
+
},
|
201
|
+
"complexType": {
|
202
|
+
"original": "IFilterField | IFilterLink",
|
203
|
+
"resolved": "IFilterField | IFilterLink",
|
204
|
+
"references": {
|
205
|
+
"IFilterField": {
|
206
|
+
"location": "import",
|
207
|
+
"path": "./interfaces"
|
208
|
+
},
|
209
|
+
"IFilterLink": {
|
210
|
+
"location": "import",
|
211
|
+
"path": "./interfaces"
|
212
|
+
}
|
213
|
+
}
|
214
|
+
}
|
215
|
+
}];
|
216
|
+
}
|
217
|
+
static get methods() {
|
218
|
+
return {
|
219
|
+
"setDataSource": {
|
220
|
+
"complexType": {
|
221
|
+
"signature": "(currentLink: IFilterLink, fetchData: DataFetcher) => Promise<void>",
|
222
|
+
"parameters": [{
|
223
|
+
"tags": [{
|
224
|
+
"name": "param",
|
225
|
+
"text": "currentLink - Link atual da entidade."
|
226
|
+
}],
|
227
|
+
"text": "- Link atual da entidade."
|
228
|
+
}, {
|
229
|
+
"tags": [{
|
230
|
+
"name": "param",
|
231
|
+
"text": "fetchData - callback que executa a busca de dados."
|
232
|
+
}],
|
233
|
+
"text": "- callback que executa a busca de dados."
|
234
|
+
}],
|
235
|
+
"references": {
|
236
|
+
"Promise": {
|
237
|
+
"location": "global"
|
238
|
+
},
|
239
|
+
"IFilterLink": {
|
240
|
+
"location": "import",
|
241
|
+
"path": "./interfaces"
|
242
|
+
},
|
243
|
+
"DataFetcher": {
|
244
|
+
"location": "import",
|
245
|
+
"path": "./interfaces"
|
246
|
+
}
|
247
|
+
},
|
248
|
+
"return": "Promise<void>"
|
249
|
+
},
|
250
|
+
"docs": {
|
251
|
+
"text": "Define a fonte de dados do componente.",
|
252
|
+
"tags": [{
|
253
|
+
"name": "param",
|
254
|
+
"text": "currentLink - Link atual da entidade."
|
255
|
+
}, {
|
256
|
+
"name": "param",
|
257
|
+
"text": "fetchData - callback que executa a busca de dados."
|
258
|
+
}, {
|
259
|
+
"name": "throws",
|
260
|
+
"text": "{Error} - Quando os metadados n\u00E3o forem v\u00E1lidos."
|
261
|
+
}, {
|
262
|
+
"name": "throws",
|
263
|
+
"text": "{Error} - Quando o link atual n\u00E3o for do tipo link."
|
264
|
+
}]
|
265
|
+
}
|
266
|
+
},
|
267
|
+
"filterDataSource": {
|
268
|
+
"complexType": {
|
269
|
+
"signature": "(filterText: string) => Promise<void>",
|
270
|
+
"parameters": [{
|
271
|
+
"tags": [{
|
272
|
+
"name": "param",
|
273
|
+
"text": "filterText - Texto para filtrar a fonte de dados."
|
274
|
+
}],
|
275
|
+
"text": "- Texto para filtrar a fonte de dados."
|
276
|
+
}],
|
277
|
+
"references": {
|
278
|
+
"Promise": {
|
279
|
+
"location": "global"
|
280
|
+
}
|
281
|
+
},
|
282
|
+
"return": "Promise<void>"
|
283
|
+
},
|
284
|
+
"docs": {
|
285
|
+
"text": "Filtra a fonte de dados do componente.",
|
286
|
+
"tags": [{
|
287
|
+
"name": "param",
|
288
|
+
"text": "filterText - Texto para filtrar a fonte de dados."
|
289
|
+
}, {
|
290
|
+
"name": "throws",
|
291
|
+
"text": "{Error} - Quando o componente estiver com a propriedade searchable como true."
|
292
|
+
}]
|
293
|
+
}
|
294
|
+
}
|
295
|
+
};
|
296
|
+
}
|
297
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './list-item';
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import { h } from "@stencil/core";
|
2
|
+
import { UserInterface } from "@sankhyalabs/core";
|
3
|
+
const ICON_MODES = {
|
4
|
+
[UserInterface.SHORTTEXT]: 'text',
|
5
|
+
[UserInterface.LONGTEXT]: 'text',
|
6
|
+
[UserInterface.INTEGERNUMBER]: 'number',
|
7
|
+
[UserInterface.DECIMALNUMBER]: 'number',
|
8
|
+
[UserInterface.DATE]: 'calendar',
|
9
|
+
[UserInterface.DATETIME]: 'calendar',
|
10
|
+
[UserInterface.SWITCH]: 'boolean',
|
11
|
+
[UserInterface.CHECKBOX]: 'check-circle-inverted',
|
12
|
+
[UserInterface.OPTIONSELECTOR]: 'list',
|
13
|
+
[UserInterface.SEARCH]: 'search',
|
14
|
+
[UserInterface.HTML]: 'tag_code',
|
15
|
+
[UserInterface.IMAGE]: 'png',
|
16
|
+
[UserInterface.FILE]: 'edit-file',
|
17
|
+
[UserInterface.TIME]: 'timer-outline',
|
18
|
+
[UserInterface.ELAPSEDTIME]: 'timer',
|
19
|
+
[UserInterface.MASKEDTEXT]: 'text',
|
20
|
+
[UserInterface.PASSWORD]: 'email',
|
21
|
+
};
|
22
|
+
export const ListItem = ({ userInterface, description }) => {
|
23
|
+
return (h("ez-icon", { iconName: ICON_MODES[userInterface], className: "ez-padding-left--small", title: description }));
|
24
|
+
};
|
@@ -0,0 +1,27 @@
|
|
1
|
+
:host {
|
2
|
+
display: flex;
|
3
|
+
height: 100%;
|
4
|
+
width: 100%;
|
5
|
+
}
|
6
|
+
|
7
|
+
.simple-crud__container {
|
8
|
+
display: grid;
|
9
|
+
grid-template-rows: auto;
|
10
|
+
row-gap: 12px;
|
11
|
+
height: 100%;
|
12
|
+
width: 100%;
|
13
|
+
}
|
14
|
+
|
15
|
+
.simple-crud__taskbar {
|
16
|
+
z-index: var(--more-visible, 2);
|
17
|
+
margin-bottom: var(--space--medium);
|
18
|
+
}
|
19
|
+
|
20
|
+
ez-grid{
|
21
|
+
--ez-grid__container--shadow: none;
|
22
|
+
min-height: 300px;
|
23
|
+
}
|
24
|
+
|
25
|
+
ez-form{
|
26
|
+
min-height: 300px;
|
27
|
+
}
|