@sankhyalabs/ezui 5.20.0-dev.2 → 5.20.0-dev.21
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 +4 -5
- package/dist/cjs/{CSSVarsUtils-b136a156.js → CSSVarsUtils-10c9d5b4.js} +13 -0
- package/dist/cjs/ez-actions-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-alert-list.cjs.entry.js +33 -28
- package/dist/cjs/ez-card-item_3.cjs.entry.js +6 -5
- package/dist/cjs/ez-combo-box.cjs.entry.js +8 -7
- package/dist/cjs/ez-date-input.cjs.entry.js +4 -1
- package/dist/cjs/ez-date-time-input.cjs.entry.js +4 -1
- package/dist/cjs/ez-form-view.cjs.entry.js +34 -15
- package/dist/cjs/ez-grid.cjs.entry.js +91 -30
- package/dist/cjs/ez-icon.cjs.entry.js +1 -1
- package/dist/cjs/ez-multi-selection-list.cjs.entry.js +2 -10
- package/dist/cjs/ez-number-input.cjs.entry.js +4 -1
- package/dist/cjs/ez-popup.cjs.entry.js +1 -1
- package/dist/cjs/ez-search.cjs.entry.js +7 -8
- package/dist/cjs/ez-split-button.cjs.entry.js +147 -0
- package/dist/cjs/ez-split-item.cjs.entry.js +20 -2
- package/dist/cjs/ez-split-panel.cjs.entry.js +15 -12
- package/dist/cjs/ez-time-input.cjs.entry.js +1 -1
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/filter-column.cjs.entry.js +16 -5
- package/dist/cjs/index-a7b0c73d.js +8 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/ez-alert-list/ez-alert-list.js +33 -28
- package/dist/collection/components/ez-card-item/ez-card-item.css +39 -6
- package/dist/collection/components/ez-card-item/ez-card-item.js +22 -3
- package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css +1 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +7 -6
- package/dist/collection/components/ez-date-input/ez-date-input.js +3 -0
- package/dist/collection/components/ez-date-time-input/ez-date-time-input.js +3 -0
- package/dist/collection/components/ez-form-view/ez-form-view.css +17 -1
- package/dist/collection/components/ez-form-view/ez-form-view.js +22 -5
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/CheckBox.tpl.js +1 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/ComboBox.tpl.js +1 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/DateInput.tpl.js +3 -3
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/FileInput.tpl.js +4 -2
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/NumberInput.tpl.js +1 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/SearchInput.tpl.js +1 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/TextInput.tpl.js +1 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +12 -11
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +15 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomHeader.js +1 -3
- package/dist/collection/components/ez-grid/ez-grid.css +25 -1
- package/dist/collection/components/ez-grid/ez-grid.js +67 -10
- package/dist/collection/components/ez-grid/subcomponents/filter-column.js +16 -5
- package/dist/collection/components/ez-icon/ez-icon.css +1 -1
- package/dist/collection/components/ez-multi-selection-list/ez-multi-selection-list.js +2 -10
- package/dist/collection/components/ez-number-input/ez-number-input.js +3 -0
- package/dist/collection/components/ez-popup/ez-popup.css +2 -5
- package/dist/collection/components/ez-search/ez-search.css +2 -1
- package/dist/collection/components/ez-search/ez-search.js +5 -6
- package/dist/collection/components/ez-split-button/ez-split-button.css +229 -0
- package/dist/collection/components/ez-split-button/ez-split-button.js +436 -0
- package/dist/collection/components/ez-split-button/test/dropdownItems.js +42 -0
- package/dist/collection/components/ez-split-panel/ez-split-panel.css +6 -7
- package/dist/collection/components/ez-split-panel/ez-split-panel.js +35 -14
- package/dist/collection/components/ez-split-panel/structure/item/ez-split-item.css +47 -12
- package/dist/collection/components/ez-split-panel/structure/item/ez-split-item.js +82 -2
- package/dist/collection/utils/CSSVarsUtils.js +13 -0
- package/dist/collection/utils/form/test/DataBinder.test.js +9 -0
- package/dist/custom-elements/index.d.ts +6 -0
- package/dist/custom-elements/index.js +394 -124
- package/dist/esm/{CSSVarsUtils-a97cfa29.js → CSSVarsUtils-71ce76be.js} +13 -0
- package/dist/esm/ez-actions-button.entry.js +1 -1
- package/dist/esm/ez-alert-list.entry.js +33 -28
- package/dist/esm/ez-card-item_3.entry.js +6 -5
- package/dist/esm/ez-combo-box.entry.js +8 -7
- package/dist/esm/ez-date-input.entry.js +4 -1
- package/dist/esm/ez-date-time-input.entry.js +4 -1
- package/dist/esm/ez-form-view.entry.js +35 -16
- package/dist/esm/ez-grid.entry.js +92 -31
- package/dist/esm/ez-icon.entry.js +1 -1
- package/dist/esm/ez-multi-selection-list.entry.js +2 -10
- package/dist/esm/ez-number-input.entry.js +4 -1
- package/dist/esm/ez-popup.entry.js +1 -1
- package/dist/esm/ez-search.entry.js +7 -8
- package/dist/esm/ez-split-button.entry.js +143 -0
- package/dist/esm/ez-split-item.entry.js +20 -2
- package/dist/esm/ez-split-panel.entry.js +15 -12
- package/dist/esm/ez-time-input.entry.js +1 -1
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/filter-column.entry.js +16 -5
- package/dist/esm/index-baa5e267.js +8 -4
- package/dist/esm/loader.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/{p-f56dd1da.entry.js → p-07cbffce.entry.js} +1 -1
- package/dist/ezui/p-13dbad96.entry.js +1 -0
- package/dist/ezui/p-2eb8f73b.entry.js +1 -0
- package/dist/ezui/{p-40f72de4.entry.js → p-784fe207.entry.js} +1 -1
- package/dist/ezui/p-7af81663.entry.js +1 -0
- package/dist/ezui/p-801fd0f8.entry.js +1 -0
- package/dist/ezui/p-807560f0.entry.js +1 -0
- package/dist/ezui/p-940ed30b.entry.js +1 -0
- package/dist/ezui/{p-eb36f072.entry.js → p-99ead599.entry.js} +1 -1
- package/dist/ezui/{p-7eb3e1a5.js → p-9e11fc7b.js} +1 -1
- package/dist/ezui/p-9f1e89c9.entry.js +1 -0
- package/dist/ezui/{p-6e2f8e6b.entry.js → p-a2704c1a.entry.js} +2 -2
- package/dist/ezui/{p-51c5e071.entry.js → p-abc23d6f.entry.js} +1 -1
- package/dist/ezui/p-af95cd16.entry.js +1 -0
- package/dist/ezui/{p-c0f1715f.entry.js → p-b567fa8c.entry.js} +1 -1
- package/dist/ezui/p-b9fbf4e7.entry.js +1 -0
- package/dist/ezui/p-baf80b13.entry.js +1 -0
- package/dist/ezui/p-db77a984.entry.js +1 -0
- package/dist/ezui/{p-9cad9b6e.entry.js → p-e85c48d7.entry.js} +1 -1
- package/dist/types/components/ez-alert-list/ez-alert-list.d.ts +1 -1
- package/dist/types/components/ez-card-item/ez-card-item.d.ts +4 -0
- package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +1 -0
- package/dist/types/components/ez-form-view/ez-form-view.d.ts +3 -0
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +1 -0
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +1 -0
- package/dist/types/components/ez-grid/controller/ag-grid/DataSource.d.ts +2 -1
- package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomHeader.d.ts +1 -1
- package/dist/types/components/ez-grid/ez-grid.d.ts +15 -2
- package/dist/types/components/ez-grid/subcomponents/filter-column.d.ts +4 -1
- package/dist/types/components/ez-multi-selection-list/ez-multi-selection-list.d.ts +0 -1
- package/dist/types/components/ez-split-button/ez-split-button.d.ts +89 -0
- package/dist/types/components/ez-split-button/test/dropdownItems.d.ts +2 -0
- package/dist/types/components/ez-split-panel/ez-split-panel.d.ts +23 -0
- package/dist/types/components/ez-split-panel/structure/item/ez-split-item.d.ts +27 -0
- package/dist/types/components.d.ts +155 -0
- package/dist/types/utils/CSSVarsUtils.d.ts +1 -0
- package/dist/types/utils/form/test/DataBinder.test.d.ts +1 -0
- package/package.json +13 -5
- package/react/components.d.ts +1 -0
- package/react/components.js +1 -0
- package/react/components.js.map +1 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridUtils.js +0 -8
- package/dist/ezui/p-133fae4a.entry.js +0 -1
- package/dist/ezui/p-24d3fede.entry.js +0 -1
- package/dist/ezui/p-43b03119.entry.js +0 -1
- package/dist/ezui/p-4a7f113d.entry.js +0 -1
- package/dist/ezui/p-596634e9.entry.js +0 -1
- package/dist/ezui/p-76ba9d67.entry.js +0 -1
- package/dist/ezui/p-796c1a88.entry.js +0 -1
- package/dist/ezui/p-af15c277.entry.js +0 -1
- package/dist/ezui/p-ba875f37.entry.js +0 -1
- package/dist/ezui/p-d6ffe679.entry.js +0 -1
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridUtils.d.ts +0 -1
|
@@ -64,6 +64,19 @@ class CSSVarsUtils {
|
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
+
static applyVarsGrid(host, child) {
|
|
68
|
+
if (child) {
|
|
69
|
+
[
|
|
70
|
+
"--ez-grid--min-height",
|
|
71
|
+
"--snk-grid-min-height",
|
|
72
|
+
].forEach(prop => {
|
|
73
|
+
const propValue = getComputedStyle(host).getPropertyValue(prop);
|
|
74
|
+
if (propValue !== null && propValue !== undefined) {
|
|
75
|
+
child.style.setProperty(prop, propValue);
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
67
80
|
static applyIfExists(host, element, varName) {
|
|
68
81
|
const prop = getComputedStyle(host).getPropertyValue(varName);
|
|
69
82
|
if (prop) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-baa5e267.js';
|
|
2
2
|
import { FloatingManager, ElementIDUtils } from '@sankhyalabs/core';
|
|
3
3
|
import './ApplicationUtils-eaf91331.js';
|
|
4
|
-
import { C as CSSVarsUtils } from './CSSVarsUtils-
|
|
4
|
+
import { C as CSSVarsUtils } from './CSSVarsUtils-71ce76be.js';
|
|
5
5
|
import './DialogType-54a62731.js';
|
|
6
6
|
import './CheckMode-bdb2ec19.js';
|
|
7
7
|
|
|
@@ -57,11 +57,13 @@ const EzAlertList = class {
|
|
|
57
57
|
/**
|
|
58
58
|
* Gerencia a exibição do overlay usando FloatingManager do Core.
|
|
59
59
|
*/
|
|
60
|
-
|
|
61
|
-
if (this.opened) {
|
|
60
|
+
manageOverlay() {
|
|
61
|
+
if (this.opened && this._container) {
|
|
62
62
|
this._overlayId = FloatingManager.float(this._container, this._overlayRef, this.getFloatOptions());
|
|
63
63
|
}
|
|
64
64
|
else {
|
|
65
|
+
if (this._overlayId === undefined)
|
|
66
|
+
return;
|
|
65
67
|
FloatingManager.close(this._overlayId);
|
|
66
68
|
this._overlayId = undefined;
|
|
67
69
|
}
|
|
@@ -70,8 +72,10 @@ const EzAlertList = class {
|
|
|
70
72
|
* Atualiza a posição da lista.
|
|
71
73
|
*/
|
|
72
74
|
updatePosition(right, bottom) {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
+
if (this.opened) {
|
|
76
|
+
FloatingManager.updateFloatPosition(this._container, this._overlayRef, Object.assign(Object.assign({}, this.getFloatOptions()), { right,
|
|
77
|
+
bottom }));
|
|
78
|
+
}
|
|
75
79
|
}
|
|
76
80
|
;
|
|
77
81
|
/**
|
|
@@ -80,7 +84,7 @@ const EzAlertList = class {
|
|
|
80
84
|
getFloatOptions() {
|
|
81
85
|
return {
|
|
82
86
|
autoClose: false,
|
|
83
|
-
isFixed:
|
|
87
|
+
isFixed: true,
|
|
84
88
|
bottom: '10px',
|
|
85
89
|
right: '10px',
|
|
86
90
|
};
|
|
@@ -102,9 +106,9 @@ const EzAlertList = class {
|
|
|
102
106
|
const boxHeight = this._container.getBoundingClientRect().height;
|
|
103
107
|
return ((docHeight - boxHeight) / 2) + 'px';
|
|
104
108
|
}
|
|
105
|
-
|
|
109
|
+
componentDidLoad() {
|
|
106
110
|
this.manageOverlay();
|
|
107
|
-
if (this.opened) {
|
|
111
|
+
if (this.opened && this._container) {
|
|
108
112
|
this._container.focus();
|
|
109
113
|
}
|
|
110
114
|
}
|
|
@@ -112,27 +116,28 @@ const EzAlertList = class {
|
|
|
112
116
|
this.dataElementId = ElementIDUtils.addIDInfo(this._element, 'EzAlertList');
|
|
113
117
|
}
|
|
114
118
|
render() {
|
|
115
|
-
return (h(Host, Object.assign({}, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: this.dataElementId }),
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
119
|
+
return (h(Host, Object.assign({}, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: this.dataElementId }), this.opened ?
|
|
120
|
+
(h("div", { ref: elem => (this._overlayRef = elem) }, h("div", { class: `alert-list__container ${this.expanded ? 'expanded' : ''}`, ref: elem => (this._container = elem) }, h("div", { class: "alert-list__content" }, h("div", { class: "alert-list__header" }, h("div", { class: "alert-list__title" }, `Avisos (${this.alerts.length})`), h("div", { class: "alert-list__header__buttons" }, this.enableExpand && (h("ez-button", { mode: "icon", size: "small", iconName: "expand", onClick: () => this.toggleExpandContainer(), "data-element-id": ElementIDUtils.getInternalIDInfo('expandButton'), title: this.expanded ? 'Resumir' : 'Expandir' })), h("ez-button", { mode: "icon", size: "small", iconName: "close", "data-element-id": ElementIDUtils.getInternalIDInfo('closeButton'), onClick: () => {
|
|
121
|
+
this.opened = false;
|
|
122
|
+
}, title: 'Fechar' }))), h("div", { class: "alert-list__expandable-content" }, h("ez-list", { itemSlotBuilder: this.itemRightSlotBuilder, hoverFeedback: true, itemLeftSlotBuilder: item => {
|
|
123
|
+
return (h("a", { href: "#", style: {
|
|
124
|
+
fontFamily: "var(--font-pattern, 'Roboto')",
|
|
125
|
+
fontSize: 'var(--text--medium, 14px)',
|
|
126
|
+
fontWeight: 'var(--text-weight--medium, 400)',
|
|
127
|
+
color: 'var(--color--primary, #008561)',
|
|
128
|
+
marginRight: '4px',
|
|
129
|
+
cursor: 'pointer',
|
|
130
|
+
display: 'flex',
|
|
131
|
+
width: 'max-content',
|
|
132
|
+
textDecoration: 'none'
|
|
133
|
+
} }, this.getTitleText(item)));
|
|
134
|
+
}, dataSource: this.alerts.map((alert, index) => {
|
|
135
|
+
var _a;
|
|
136
|
+
return {
|
|
137
|
+
id: this.alertId(alert.title, index),
|
|
138
|
+
label: (_a = alert.detail) !== null && _a !== void 0 ? _a : "",
|
|
139
|
+
};
|
|
140
|
+
}) })))))) : null));
|
|
136
141
|
}
|
|
137
142
|
get _element() { return getElement(this); }
|
|
138
143
|
static get watchers() { return {
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-baa5e267.js';
|
|
2
2
|
import { StringUtils, ElementIDUtils } from '@sankhyalabs/core';
|
|
3
|
-
import { C as CSSVarsUtils } from './CSSVarsUtils-
|
|
3
|
+
import { C as CSSVarsUtils } from './CSSVarsUtils-71ce76be.js';
|
|
4
4
|
|
|
5
|
-
const ezCardItemCss = ":host {\n /*@doc Define o tamanho da fonte do componente.*/\n --ez-card-item--font-size: var(--text--medium, 14px);\n\n /*@doc Define a família da fonte do componente.*/\n --ez-card-item--font-family: var(--font-pattern, Arial);\n\n /*@doc Define o peso da fonte do componente.*/\n --ez-card-item--font-weight: var(--text-weight--medium, 400);\n\n /*@doc Define o peso da fonte do title do componente.*/\n --ez-card-item--font-weight-large: var(--text-weight--large, 600);\n\n /*@doc Define a cor da fonte do componente.*/\n --ez-card-item--color: var(--title--primary, #2B3A54);\n\n /*@doc Define a cor da fonte da key do componente.*/\n --ez-card-item__key--color: var(--text--primary, #626e82);\n\n /*@doc Define a cor da fonte do label do detalhe do componente.*/\n --ez-card-item__detail-label--color: var(--text--secondary, #A2ABB9);\n\n /*@doc Define o espaçamento inferior dos detalhes do componente.*/\n --ez-card-item__detail--padding-bottom: var(--space--extra-small, 3px);\n\n /*@doc Define o espaçamento inferior do title do componente.*/\n --ez-card-item__title--padding-bottom: var(--space--extra-small, 3px);\n\n /*@doc Define a cor do highlight / marcação nos textos do componente.*/\n --ez-card-item__highlight--color: var(--color--primary-300, #E2F4EF);\n\n width: 100%;\n display: flex;\n cursor: pointer;\n}\n\n.card-item {\n display: flex;\n flex-direction: column;\n width: 100%;\n cursor: pointer;\n padding: 12px;\n z-index: 0;\n position: relative;\n container-type: inline-size;\n container-name: box;\n}\n\n.card-item:hover {\n background: #F0F3F7;\n border-radius: 12px;\n}\n\n.card-item__title {\n display: flex;\n align-items: center;\n line-height: 18px;\n cursor: pointer;\n\n /*public*/\n font-size: var(--ez-card-item--font-size);\n font-family: var(--ez-card-item--font-family);\n font-weight: var(--ez-card-item--font-weight-large);\n color: var(--ez-card-item--color);\n padding-bottom: var(--ez-card-item__title--padding-bottom);\n gap: var(--space--small, 6px);\n}\n\n.card-item__key {\n /*public*/\n color: var(--ez-card-item__key--color);\n}\n\n.card-item__details {\n display: flex;\n cursor: pointer;\n justify-content: space-between;\n
|
|
5
|
+
const ezCardItemCss = ":host {\n /*@doc Define o tamanho da fonte do componente.*/\n --ez-card-item--font-size: var(--text--medium, 14px);\n\n /*@doc Define a família da fonte do componente.*/\n --ez-card-item--font-family: var(--font-pattern, Arial);\n\n /*@doc Define o peso da fonte do componente.*/\n --ez-card-item--font-weight: var(--text-weight--medium, 400);\n\n /*@doc Define o peso da fonte do title do componente.*/\n --ez-card-item--font-weight-large: var(--text-weight--large, 600);\n\n /*@doc Define a cor da fonte do componente.*/\n --ez-card-item--color: var(--title--primary, #2B3A54);\n\n /*@doc Define a cor da fonte da key do componente.*/\n --ez-card-item__key--color: var(--text--primary, #626e82);\n\n /*@doc Define a cor da fonte do label do detalhe do componente.*/\n --ez-card-item__detail-label--color: var(--text--secondary, #A2ABB9);\n\n /*@doc Define o espaçamento inferior dos detalhes do componente.*/\n --ez-card-item__detail--padding-bottom: var(--space--extra-small, 3px);\n\n /*@doc Define o espaçamento inferior do title do componente.*/\n --ez-card-item__title--padding-bottom: var(--space--extra-small, 3px);\n\n /*@doc Define a cor do highlight / marcação nos textos do componente.*/\n --ez-card-item__highlight--color: var(--color--primary-300, #E2F4EF);\n\n width: 100%;\n display: flex;\n cursor: pointer;\n}\n\n.card-item {\n display: flex;\n flex-direction: column;\n width: 100%;\n cursor: pointer;\n padding: 12px;\n z-index: 0;\n position: relative;\n container-type: inline-size;\n container-name: box;\n white-space: pre-line;\n}\n\n.card-item:hover {\n background: #F0F3F7;\n border-radius: 12px;\n}\n\n.card-item__title {\n display: flex;\n align-items: center;\n line-height: 18px;\n cursor: pointer;\n\n /*public*/\n font-size: var(--ez-card-item--font-size);\n font-family: var(--ez-card-item--font-family);\n font-weight: var(--ez-card-item--font-weight-large);\n color: var(--ez-card-item--color);\n padding-bottom: var(--ez-card-item__title--padding-bottom);\n gap: var(--space--small, 6px);\n}\n\n.card-item__key {\n /*public*/\n color: var(--ez-card-item__key--color);\n}\n\n.card-item__details {\n display: flex;\n flex-direction: column;\n cursor: pointer;\n justify-content: space-between;\n width: 100%;\n}\n\n.card-item__details-container__left {\n white-space: pre-line;\n cursor: pointer;\n width: 50%;\n}\n\n.card-item__details-container__right {\n white-space: pre-line;\n width: 50%;\n cursor: pointer;\n}\n\n.card-item__detail:not(:last-child) {\n cursor: pointer;\n white-space: pre-line;\n\n /*public*/\n padding-bottom: var(--ez-card-item__detail--padding-bottom);\n}\n\n.card-item__detail-label {\n cursor: pointer;\n\n /*public*/\n font-size: var(--ez-card-item--font-size);\n font-family: var(--ez-card-item--font-family);\n font-weight: var(--ez-card-item--font-weight);\n color: var(--ez-card-item__detail-label--color);\n}\n\n.card-item__detail-value {\n cursor: pointer;\n line-break: anywhere;\n\n /*public*/\n font-size: var(--ez-card-item--font-size);\n font-family: var(--ez-card-item--font-family);\n font-weight: var(--ez-card-item--font-weight);\n color: var(--ez-card-item--color);\n}\n\n.card-item__highlight {\n position: relative;\n border-radius: 8px;\n z-index: -1;\n\n /*public*/\n background-color: var(--ez-card-item__highlight--color);\n outline: 2px solid var(--ez-card-item__highlight--color);\n box-shadow: -4px 0px 0px 0px var(--ez-card-item__highlight--color), \n 4px 0px 0px 0px var(--ez-card-item__highlight--color);\n}\n\n.card-item__content{\n display: flex;\n align-items: center;\n}\n\n.card-item__details-container{\n display: flex;\n}\n\n.card-item__details-slot{\n margin-left: auto;\n}\n\n@container box (max-width: 550px) {\n .card-item__details {\n flex-direction: column;\n }\n\n .card-item__details-container__left {\n width: 100%;\n }\n \n .card-item__details-container__right {\n width: 100%;\n }\n}\n\n@container box (max-width: 200px) {\n .card-item__title {\n font-size: 10px;\n }\n\n .card-item__detail-label {\n font-size: 10px;\n }\n\n .card-item__detail-value {\n font-size: 10px;\n }\n\n}";
|
|
6
6
|
|
|
7
7
|
const EzCardItem = class {
|
|
8
8
|
constructor(hostRef) {
|
|
9
9
|
registerInstance(this, hostRef);
|
|
10
10
|
this.ezClick = createEvent(this, "ezClick", 7);
|
|
11
11
|
this.item = undefined;
|
|
12
|
+
this.enableKey = true;
|
|
12
13
|
}
|
|
13
14
|
componentWillRender() {
|
|
14
15
|
this.createDetailList();
|
|
@@ -36,11 +37,11 @@ const EzCardItem = class {
|
|
|
36
37
|
}
|
|
37
38
|
render() {
|
|
38
39
|
return (h(Host, null, this.item &&
|
|
39
|
-
h("div", { class: "card-item", onClick: () => { this.ezClick.emit(this.item); } }, h("label", { class: "card-item__title" }, h("span", { class: "card-item__key", innerHTML: this.item.key }), h("span", { innerHTML: this.item.title })), h("div", { class: "card-item__details" }, h("div", { class: "card-item__details-
|
|
40
|
+
h("div", { class: "card-item", onClick: () => { this.ezClick.emit(this.item); } }, h("div", { class: "ez-row card-item__content" }, h("div", { class: "ez-col ez-col--sd-11 card-item__details" }, h("label", { class: "card-item__title" }, this.enableKey && (h("span", { class: "card-item__key", innerHTML: this.item.key })), h("span", { innerHTML: this.item.title })), h("div", { class: "card-item__details-container" }, h("div", { class: "card-item__details-container__left" }, this._details.detailsLeft.map(detail => {
|
|
40
41
|
return this.buildDetailContent(detail);
|
|
41
|
-
})), h("div", { class: "card-item__details-
|
|
42
|
+
})), h("div", { class: "card-item__details-container__right" }, this._details.detailsRight.map(detail => {
|
|
42
43
|
return this.buildDetailContent(detail);
|
|
43
|
-
}))))));
|
|
44
|
+
})))), h("div", { class: "ez-col ez-col--sd-1 card-item__details-slot" }, h("slot", { name: "rightSlot" }))))));
|
|
44
45
|
}
|
|
45
46
|
get _element() { return getElement(this); }
|
|
46
47
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-baa5e267.js';
|
|
2
2
|
import { ObjectUtils, FloatingManager, ElementIDUtils } from '@sankhyalabs/core';
|
|
3
3
|
import './ApplicationUtils-eaf91331.js';
|
|
4
|
-
import { C as CSSVarsUtils } from './CSSVarsUtils-
|
|
4
|
+
import { C as CSSVarsUtils } from './CSSVarsUtils-71ce76be.js';
|
|
5
5
|
import './DialogType-54a62731.js';
|
|
6
6
|
import './CheckMode-bdb2ec19.js';
|
|
7
7
|
|
|
@@ -218,14 +218,15 @@ const EzComboBox = class {
|
|
|
218
218
|
const upperCriteria = this._criteria.toUpperCase();
|
|
219
219
|
opts = opts.filter(opt => opt.label.toLocaleUpperCase().indexOf(upperCriteria) > -1);
|
|
220
220
|
}
|
|
221
|
-
if (this.
|
|
222
|
-
|
|
223
|
-
}
|
|
224
|
-
else {
|
|
225
|
-
this._visibleOptions = [{ value: undefined, label: "" }].concat(opts);
|
|
221
|
+
if (this.hasToAddEmptyoption(opts)) {
|
|
222
|
+
opts = [{ value: undefined, label: "" }].concat(opts);
|
|
226
223
|
}
|
|
224
|
+
this._visibleOptions = opts;
|
|
227
225
|
this._maxWidthValue = this.getMaxWidthValue();
|
|
228
226
|
}
|
|
227
|
+
hasToAddEmptyoption(opts) {
|
|
228
|
+
return !this.suppressEmptyOption && !opts.filter(opt => !opt.value).length;
|
|
229
|
+
}
|
|
229
230
|
getMaxWidthValue() {
|
|
230
231
|
var _a;
|
|
231
232
|
if (this.showOptionValue) {
|
|
@@ -366,7 +367,7 @@ const EzComboBox = class {
|
|
|
366
367
|
}
|
|
367
368
|
else {
|
|
368
369
|
window.setTimeout(() => {
|
|
369
|
-
this.setInputValue();
|
|
370
|
+
this.setInputValue(false);
|
|
370
371
|
}, this._deboucingTime);
|
|
371
372
|
}
|
|
372
373
|
this.resetOptions();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-baa5e267.js';
|
|
2
2
|
import { DateUtils, ElementIDUtils } from '@sankhyalabs/core';
|
|
3
|
-
import { C as CSSVarsUtils } from './CSSVarsUtils-
|
|
3
|
+
import { C as CSSVarsUtils } from './CSSVarsUtils-71ce76be.js';
|
|
4
4
|
|
|
5
5
|
const ezDateInputCss = ":host{display:block;width:100%;--ez-date-input__input--background-color:var(--background--medium, #e0e0e0);--ez-date-input__input--border-color:var(--ez-date-input__input--background-color);--ez-date-input__calendar-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"15px\"><path d=\"M 3.171875,5.25 C 2.6485088,5.25 2.21875,5.6797588 2.21875,6.203125 2.21875,6.7264912 2.6485088,7.15625 3.171875,7.15625 3.6952412,7.15625 4.125,6.7264912 4.125,6.203125 4.125,5.6797588 3.6952412,5.25 3.171875,5.25 Z m 2.875,0 C 5.5235088,5.25 5.09375,5.6797588 5.09375,6.203125 5.09375,6.7264912 5.5235088,7.15625 6.046875,7.15625 6.5702412,7.15625 7,6.7264912 7,6.203125 7,5.6797588 6.5702412,5.25 6.046875,5.25 Z m 2.875,0 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.953125 0.953125,0.953125 0.5233662,0 0.9511719,-0.4297588 0.9511719,-0.953125 C 9.8730469,5.6797588 9.4452412,5.25 8.921875,5.25 Z m 2.873047,0 c -0.523366,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.429759,0.953125 0.953125,0.953125 0.523366,0 0.953125,-0.4297588 0.953125,-0.953125 C 12.748047,5.6797588 12.318288,5.25 11.794922,5.25 Z M 3.171875,8.1230469 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.9531251 0.953125,0.9531251 0.5233662,0 0.953125,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.875,0 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.9531251 0.953125,0.9531251 C 6.5702412,10.029297 7,9.5995381 7,9.0761719 7,8.5528057 6.5702412,8.1230469 6.046875,8.1230469 Z m 2.8554688,0 c -0.5233663,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297587,0.9531251 0.953125,0.9531251 0.5233661,0 0.9531249,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.9003902,0 c -0.523366,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.429759,0.9531251 0.953125,0.9531251 0.523367,0 0.953125,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.429758,-0.953125 -0.953125,-0.953125 z M 3.171875,10.998047 c -0.5233662,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297588,0.953125 0.953125,0.953125 0.5233662,0 0.953125,-0.429759 0.953125,-0.953125 0,-0.523366 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.875,0 c -0.5233662,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297588,0.953125 0.953125,0.953125 C 6.5702412,12.904297 7,12.474538 7,11.951172 7,11.427806 6.5702412,10.998047 6.046875,10.998047 Z m 2.8554688,0 c -0.5233663,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297587,0.953125 0.953125,0.953125 0.5233661,0 0.9531249,-0.429759 0.953125,-0.953125 0,-0.523366 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.9003902,0 c -0.523366,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.429759,0.953125 0.953125,0.953125 0.523367,0 0.953125,-0.429759 0.953125,-0.953125 0,-0.523366 -0.429758,-0.953125 -0.953125,-0.953125 z M 3.5,0 c -0.554,0 -1,0.446 -1,1 v 0.050781 C 1.0853217,1.2909766 0,2.5186658 0,4 v 9 c 0,1.652487 1.3475134,3 3,3 h 9 c 1.652487,0 3,-1.347513 3,-3 V 4 C 15,2.5186658 13.914678,1.2909766 12.5,1.0507812 V 1 c 0,-0.554 -0.446,-1 -1,-1 -0.554,0 -1,0.446 -1,1 h -2 c 0,-0.554 -0.446,-1 -1,-1 -0.554,0 -1,0.446 -1,1 h -2 C 4.5,0.446 4.054,0 3.5,0 Z m 1,2.0996094 h 2 v 0.640625 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 v -0.640625 h 2 v 0.640625 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 V 2.1738281 C 13.311725,2.3905225 13.900391,3.11278 13.900391,4 v 9 c 0,1.062113 -0.838278,1.900391 -1.900391,1.900391 H 3 C 1.9378864,14.900391 1.0996094,14.062113 1.0996094,13 V 4 C 1.0996094,3.11278 1.6882747,2.3905225 2.5,2.1738281 v 0.5664063 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 z\"/></svg>')}.btn-open-cal{outline:none;border:none;background-color:unset;cursor:pointer}.btn-open-cal:disabled{cursor:unset}.btn-open-cal::after{content:'';display:flex;background-color:var(--text--primary, #008561);width:15px;height:16px;-webkit-mask-image:var(--ez-date-input__calendar-image);mask-image:var(--ez-date-input__calendar-image)}.btn-open-cal:disabled:after{background-color:var(--text--disable, #AFB6C0)}.btn-open-cal:enabled:hover::after{background-color:var(--color--primary, #4e4e4e)}ez-text-input{--text-input__input--background-color:var(--ez-date-input__input--background-color, #FFFFFF);--text-input__input--border-color:var(--ez-date-input__input--border-color, #DCE0E8)}";
|
|
6
6
|
|
|
@@ -107,6 +107,9 @@ const EzDateInput = class {
|
|
|
107
107
|
this._calendar.hide();
|
|
108
108
|
}
|
|
109
109
|
handleBlur() {
|
|
110
|
+
if (!this._changePending) {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
110
113
|
try {
|
|
111
114
|
const strValue = this._textInput.value;
|
|
112
115
|
const newValue = DateUtils.strToDate(strValue);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-baa5e267.js';
|
|
2
2
|
import { DateUtils, TimeFormatter, ElementIDUtils } from '@sankhyalabs/core';
|
|
3
|
-
import { C as CSSVarsUtils } from './CSSVarsUtils-
|
|
3
|
+
import { C as CSSVarsUtils } from './CSSVarsUtils-71ce76be.js';
|
|
4
4
|
|
|
5
5
|
const ezDateTimeInputCss = ":host{display:block;width:100%;--ez-date-input__input--background-color:var(--background--medium, #e0e0e0);--ez-date-input__input--border-color:var(--ez-date-input__input--background-color);--ez-date-input__calendar-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"15px\"><path d=\"M 3.171875,5.25 C 2.6485088,5.25 2.21875,5.6797588 2.21875,6.203125 2.21875,6.7264912 2.6485088,7.15625 3.171875,7.15625 3.6952412,7.15625 4.125,6.7264912 4.125,6.203125 4.125,5.6797588 3.6952412,5.25 3.171875,5.25 Z m 2.875,0 C 5.5235088,5.25 5.09375,5.6797588 5.09375,6.203125 5.09375,6.7264912 5.5235088,7.15625 6.046875,7.15625 6.5702412,7.15625 7,6.7264912 7,6.203125 7,5.6797588 6.5702412,5.25 6.046875,5.25 Z m 2.875,0 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.953125 0.953125,0.953125 0.5233662,0 0.9511719,-0.4297588 0.9511719,-0.953125 C 9.8730469,5.6797588 9.4452412,5.25 8.921875,5.25 Z m 2.873047,0 c -0.523366,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.429759,0.953125 0.953125,0.953125 0.523366,0 0.953125,-0.4297588 0.953125,-0.953125 C 12.748047,5.6797588 12.318288,5.25 11.794922,5.25 Z M 3.171875,8.1230469 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.9531251 0.953125,0.9531251 0.5233662,0 0.953125,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.875,0 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.9531251 0.953125,0.9531251 C 6.5702412,10.029297 7,9.5995381 7,9.0761719 7,8.5528057 6.5702412,8.1230469 6.046875,8.1230469 Z m 2.8554688,0 c -0.5233663,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297587,0.9531251 0.953125,0.9531251 0.5233661,0 0.9531249,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.9003902,0 c -0.523366,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.429759,0.9531251 0.953125,0.9531251 0.523367,0 0.953125,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.429758,-0.953125 -0.953125,-0.953125 z M 3.171875,10.998047 c -0.5233662,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297588,0.953125 0.953125,0.953125 0.5233662,0 0.953125,-0.429759 0.953125,-0.953125 0,-0.523366 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.875,0 c -0.5233662,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297588,0.953125 0.953125,0.953125 C 6.5702412,12.904297 7,12.474538 7,11.951172 7,11.427806 6.5702412,10.998047 6.046875,10.998047 Z m 2.8554688,0 c -0.5233663,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297587,0.953125 0.953125,0.953125 0.5233661,0 0.9531249,-0.429759 0.953125,-0.953125 0,-0.523366 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.9003902,0 c -0.523366,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.429759,0.953125 0.953125,0.953125 0.523367,0 0.953125,-0.429759 0.953125,-0.953125 0,-0.523366 -0.429758,-0.953125 -0.953125,-0.953125 z M 3.5,0 c -0.554,0 -1,0.446 -1,1 v 0.050781 C 1.0853217,1.2909766 0,2.5186658 0,4 v 9 c 0,1.652487 1.3475134,3 3,3 h 9 c 1.652487,0 3,-1.347513 3,-3 V 4 C 15,2.5186658 13.914678,1.2909766 12.5,1.0507812 V 1 c 0,-0.554 -0.446,-1 -1,-1 -0.554,0 -1,0.446 -1,1 h -2 c 0,-0.554 -0.446,-1 -1,-1 -0.554,0 -1,0.446 -1,1 h -2 C 4.5,0.446 4.054,0 3.5,0 Z m 1,2.0996094 h 2 v 0.640625 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 v -0.640625 h 2 v 0.640625 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 V 2.1738281 C 13.311725,2.3905225 13.900391,3.11278 13.900391,4 v 9 c 0,1.062113 -0.838278,1.900391 -1.900391,1.900391 H 3 C 1.9378864,14.900391 1.0996094,14.062113 1.0996094,13 V 4 C 1.0996094,3.11278 1.6882747,2.3905225 2.5,2.1738281 v 0.5664063 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 z\"/></svg>')}.btn-open-cal{outline:none;border:none;background-color:unset;cursor:pointer}.btn-open-cal:disabled{cursor:unset}.btn-open-cal::after{content:'';display:flex;background-color:var(--text--primary, #008561);width:15px;height:16px;-webkit-mask-image:var(--ez-date-input__calendar-image);mask-image:var(--ez-date-input__calendar-image)}.btn-open-cal:disabled:after{background-color:var(--text--disable, #AFB6C0)}.btn-open-cal:enabled:hover::after{background-color:var(--color--primary, #4e4e4e)}ez-text-input{--text-input__input--background-color:var(--ez-date-input__input--background-color, #FFFFFF);--text-input__input--border-color:var(--ez-date-input__input--border-color, #DCE0E8)}";
|
|
6
6
|
|
|
@@ -159,6 +159,9 @@ const EzDateTimeInput = class {
|
|
|
159
159
|
}
|
|
160
160
|
handleBlur() {
|
|
161
161
|
var _a, _b;
|
|
162
|
+
if (!this._changePending) {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
162
165
|
try {
|
|
163
166
|
const strValue = ((_b = (_a = this._textInput) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.trim()) || "";
|
|
164
167
|
const newValue = this.getParsedDateTime();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h, r as registerInstance, c as createEvent,
|
|
1
|
+
import { h, r as registerInstance, c as createEvent, g as getElement, H as Host } from './index-baa5e267.js';
|
|
2
2
|
import { ObjectUtils, UserInterface, ElementIDUtils } from '@sankhyalabs/core';
|
|
3
3
|
import { R as REQUIRED_INFO } from './constants-4e0d35b7.js';
|
|
4
4
|
import { C as CheckMode } from './CheckMode-bdb2ec19.js';
|
|
@@ -10,7 +10,7 @@ const buildCheckBox = (field) => {
|
|
|
10
10
|
return buildField(field.name, field.label, field.readOnly, field.contextName, false);
|
|
11
11
|
};
|
|
12
12
|
function buildField(fieldName, fieldLabel, readOnly, contextName, switchMode) {
|
|
13
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-
|
|
13
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-align--middle ez-padding-horizontal--small ez-padding-bottom--large" },
|
|
14
14
|
h("ez-check", { enabled: !readOnly, label: fieldLabel, mode: switchMode ? CheckMode.SWITCH : CheckMode.REGULAR, "data-field-name": fieldName, "data-context-name": contextName, key: fieldName })));
|
|
15
15
|
}
|
|
16
16
|
|
|
@@ -24,29 +24,31 @@ const buildComboBox = ({ name, label, readOnly, required, props, contextName, ca
|
|
|
24
24
|
else {
|
|
25
25
|
options = prop;
|
|
26
26
|
}
|
|
27
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-
|
|
27
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" },
|
|
28
28
|
h("ez-combo-box", { enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, "data-context-name": contextName, key: name, options: options, canShowError: canShowError })));
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
const buildDate = ({ name, label, readOnly, canShowError }) => {
|
|
32
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-
|
|
32
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" },
|
|
33
33
|
h("ez-date-input", { enabled: !readOnly, label: label, "data-field-name": name, key: name, canShowError: canShowError })));
|
|
34
34
|
};
|
|
35
35
|
const buildTime = ({ name, label, readOnly, canShowError }) => {
|
|
36
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-
|
|
36
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" },
|
|
37
37
|
h("ez-time-input", { enabled: !readOnly, label: label, "data-field-name": name, key: name, canShowError: canShowError })));
|
|
38
38
|
};
|
|
39
39
|
const buildDateTime = ({ name, label, readOnly, contextName, canShowError }) => {
|
|
40
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-
|
|
40
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" },
|
|
41
41
|
h("ez-date-time-input", { enabled: !readOnly, label: label, "data-field-name": name, "data-context-name": contextName, key: name, canShowError: canShowError })));
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
const buildFile = ({ name, label, readOnly, contextName, props }) => {
|
|
45
45
|
const uploadProps = ObjectUtils.removeEmptyValues({
|
|
46
46
|
subTitle: props.subTitle,
|
|
47
|
-
requestHeaders: props.STORAGESTRATEGY
|
|
47
|
+
requestHeaders: Object.assign(Object.assign({}, (props.STORAGESTRATEGY && {
|
|
48
48
|
STORAGESTRATEGY: props.STORAGESTRATEGY
|
|
49
|
-
}
|
|
49
|
+
})), (props.INTERNAL_FILENAME && {
|
|
50
|
+
INTERNAL_FILENAME: props.INTERNAL_FILENAME
|
|
51
|
+
})),
|
|
50
52
|
});
|
|
51
53
|
return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" },
|
|
52
54
|
h("ez-upload", Object.assign({ enabled: !readOnly, label: label, "data-field-name": name, "data-context-name": contextName, key: name }, uploadProps))));
|
|
@@ -61,12 +63,12 @@ const buildInteger = ({ name, label, readOnly, contextName, canShowError }) => {
|
|
|
61
63
|
return buildNumeric(name, label, readOnly, 0, 0, contextName, canShowError);
|
|
62
64
|
};
|
|
63
65
|
function buildNumeric(fieldName, fieldLabel, readOnly, precision, prettyPrecision, contextName, canShowError) {
|
|
64
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-
|
|
66
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" },
|
|
65
67
|
h("ez-number-input", { enabled: !readOnly, label: fieldLabel, precision: precision, prettyPrecision: prettyPrecision, "data-field-name": fieldName, "data-context-name": contextName, key: fieldName, canShowError: canShowError })));
|
|
66
68
|
}
|
|
67
69
|
|
|
68
70
|
const buildSearch = ({ name, label, readOnly, required, contextName, canShowError, optionLoader }) => {
|
|
69
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-
|
|
71
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" },
|
|
70
72
|
h("ez-search", { enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, "data-context-name": contextName, key: name, canShowError: canShowError, optionLoader: optionLoader })));
|
|
71
73
|
};
|
|
72
74
|
|
|
@@ -76,7 +78,7 @@ const buildTextArea = ({ name, label, readOnly, contextName, rows, canShowError
|
|
|
76
78
|
};
|
|
77
79
|
|
|
78
80
|
const buildTextInput = ({ name, label, readOnly, contextName, canShowError }) => {
|
|
79
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-
|
|
81
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" },
|
|
80
82
|
h("ez-text-input", { label: label, "data-field-name": name, "data-context-name": contextName, key: name, enabled: !readOnly, canShowError: canShowError })));
|
|
81
83
|
};
|
|
82
84
|
|
|
@@ -136,7 +138,7 @@ class FormItems {
|
|
|
136
138
|
}
|
|
137
139
|
}
|
|
138
140
|
|
|
139
|
-
const ezFormViewCss = ".sc-ez-form-view-h{display:flex;flex-
|
|
141
|
+
const ezFormViewCss = ".sc-ez-form-view-h{display:flex;flex-wrap:wrap;width:100%;--ez-form-view__item--min-width:220px;--ez-form-view__item--sapce-width:5px}.form-view__content.sc-ez-form-view{display:grid;grid-template-columns:repeat(auto-fill, minmax(var(--ez-form-view__item--min-width), 1fr));gap:var(--ez-form-view__item--sapce-width);width:100%}.input-full_width.sc-ez-form-view{grid-column:1 / -1;width:100%}";
|
|
140
142
|
|
|
141
143
|
const EzFormView = class {
|
|
142
144
|
constructor(hostRef) {
|
|
@@ -171,19 +173,36 @@ const EzFormView = class {
|
|
|
171
173
|
const formItems = new FormItems(Array.from(this._element.querySelectorAll("[data-form-item]")));
|
|
172
174
|
this.formItemsReady.emit(formItems);
|
|
173
175
|
}
|
|
176
|
+
isItemFullWidth(userInterface) {
|
|
177
|
+
return [
|
|
178
|
+
UserInterface.FILE,
|
|
179
|
+
UserInterface.LONGTEXT
|
|
180
|
+
].includes(userInterface);
|
|
181
|
+
}
|
|
182
|
+
buildFormItemElement(item, classItem = "") {
|
|
183
|
+
if (this.isItemFullWidth(item.userInterface)) {
|
|
184
|
+
classItem += " input-full_width";
|
|
185
|
+
}
|
|
186
|
+
return h("div", { class: classItem }, fieldBuilder(item));
|
|
187
|
+
}
|
|
174
188
|
render() {
|
|
175
189
|
ElementIDUtils.addIDInfoIfNotExists(this._element, 'ezFormView');
|
|
176
190
|
if (this.fields == undefined) {
|
|
177
191
|
return;
|
|
178
192
|
}
|
|
179
|
-
|
|
193
|
+
let nonArrayGrup = [];
|
|
194
|
+
let formContent = Array.from(this.groupFields(this.fields).entries()).map(([label, value]) => {
|
|
180
195
|
if (Array.isArray(value)) {
|
|
181
|
-
return (h("ez-collapsible-box", { id: `group-${label}`, label: label, "header-size": "large", key: label }, value.map(fi =>
|
|
196
|
+
return (h("ez-collapsible-box", { id: `group-${label}`, label: label, "header-size": "large", key: label }, h("div", { class: "form-view__content" }, value.map(fi => (this.buildFormItemElement(fi))))));
|
|
182
197
|
}
|
|
183
198
|
else {
|
|
184
|
-
|
|
199
|
+
nonArrayGrup.push(value);
|
|
185
200
|
}
|
|
186
|
-
})
|
|
201
|
+
});
|
|
202
|
+
// Filtra os elementos que não são arrays e os coloca dentro de uma única div
|
|
203
|
+
let nonArrayElements = nonArrayGrup.map((value) => this.buildFormItemElement(value));
|
|
204
|
+
let groupedNonArrayElements = h("div", { class: "form-view__content" }, nonArrayElements);
|
|
205
|
+
return (h(Host, null, groupedNonArrayElements, formContent));
|
|
187
206
|
}
|
|
188
207
|
get _element() { return getElement(this); }
|
|
189
208
|
};
|