@sankhyalabs/sankhyablocks 1.4.0-beta.8 → 2.0.0-beta.1
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/{constants-aebcc2f5.js → constants-9056ca9e.js} +15 -0
- package/dist/cjs/{index-188190ee.js → index-20e8b68a.js} +48 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/sankhyablocks.cjs.js +2 -2
- package/dist/cjs/snk-application.cjs.entry.js +27 -21
- package/dist/cjs/snk-config-modal.cjs.entry.js +3 -3
- package/dist/cjs/snk-config-options.cjs.entry.js +139 -72
- package/dist/cjs/snk-configurator_6.cjs.entry.js +5 -5
- package/dist/cjs/snk-crud.cjs.entry.js +3 -3
- package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
- package/dist/cjs/snk-field-config_2.cjs.entry.js +8 -3
- package/dist/cjs/snk-filter-binary-select.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-detail.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-multi-select.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-number.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-period.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-personalized.cjs.entry.js +3 -2
- package/dist/cjs/snk-filter-search.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-text.cjs.entry.js +1 -1
- package/dist/cjs/snk-form-config.cjs.entry.js +29 -18
- package/dist/cjs/snk-form.cjs.entry.js +1 -1
- package/dist/cjs/snk-pesquisa.cjs.entry.js +1 -1
- package/dist/cjs/snk-tab-config.cjs.entry.js +3 -3
- package/dist/cjs/{taskbar-elements-4c2c6704.js → taskbar-elements-9a4b1e19.js} +1 -1
- package/dist/cjs/teste-pesquisa.cjs.entry.js +1 -1
- package/dist/collection/components/snk-application/snk-application.js +27 -5
- package/dist/collection/components/snk-configurator/subcomponents/snk-config-modal/snk-config-modal.css +2 -2
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +1 -1
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.js +2 -1
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +3 -2
- package/dist/collection/components/snk-form/subcomponents/snk-config-options/snk-config-options.js +139 -72
- package/dist/collection/components/snk-form/subcomponents/snk-field-config/snk-field-config.js +26 -1
- package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.css +1 -1
- package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.js +27 -16
- package/dist/collection/components/snk-form/subcomponents/snk-tab-config/snk-tab-config.css +1 -1
- package/dist/collection/lib/http/data-fetcher/fetchers/parameters-fecher.js +15 -15
- package/dist/collection/lib/utils/constants.js +14 -0
- package/dist/components/constants.js +15 -1
- package/dist/components/snk-application2.js +27 -20
- package/dist/components/snk-config-modal2.js +1 -1
- package/dist/components/snk-config-options2.js +139 -72
- package/dist/components/snk-data-unit.js +1 -1
- package/dist/components/snk-field-config2.js +8 -2
- package/dist/components/snk-filter-modal2.js +3 -2
- package/dist/components/snk-filter-personalized.js +2 -1
- package/dist/components/snk-form-config2.js +28 -17
- package/dist/components/snk-tab-config2.js +2 -2
- package/dist/esm/{constants-c4e3341e.js → constants-c6039d3d.js} +15 -1
- package/dist/esm/{index-bafb2cef.js → index-e4121713.js} +48 -2
- package/dist/esm/loader.js +2 -2
- package/dist/esm/sankhyablocks.js +2 -2
- package/dist/esm/snk-application.entry.js +27 -21
- package/dist/esm/snk-config-modal.entry.js +3 -3
- package/dist/esm/snk-config-options.entry.js +140 -73
- package/dist/esm/snk-configurator_6.entry.js +6 -6
- package/dist/esm/snk-crud.entry.js +3 -3
- package/dist/esm/snk-data-unit.entry.js +2 -2
- package/dist/esm/snk-field-config_2.entry.js +8 -3
- package/dist/esm/snk-filter-binary-select.entry.js +1 -1
- package/dist/esm/snk-filter-detail.entry.js +1 -1
- package/dist/esm/snk-filter-multi-select.entry.js +1 -1
- package/dist/esm/snk-filter-number.entry.js +1 -1
- package/dist/esm/snk-filter-period.entry.js +1 -1
- package/dist/esm/snk-filter-personalized.entry.js +3 -2
- package/dist/esm/snk-filter-search.entry.js +1 -1
- package/dist/esm/snk-filter-text.entry.js +1 -1
- package/dist/esm/snk-form-config.entry.js +29 -18
- package/dist/esm/snk-form.entry.js +1 -1
- package/dist/esm/snk-pesquisa.entry.js +1 -1
- package/dist/esm/snk-tab-config.entry.js +3 -3
- package/dist/esm/{taskbar-elements-2035b1c7.js → taskbar-elements-e2ed0536.js} +1 -1
- package/dist/esm/teste-pesquisa.entry.js +1 -1
- package/dist/sankhyablocks/{p-8cd8977c.entry.js → p-029ae4e4.entry.js} +1 -1
- package/dist/sankhyablocks/p-12ad2a19.entry.js +1 -0
- package/dist/sankhyablocks/{p-1963b46f.entry.js → p-2b891c4a.entry.js} +1 -1
- package/dist/sankhyablocks/{p-d1ae76ec.entry.js → p-2dc76d79.entry.js} +1 -1
- package/dist/sankhyablocks/{p-916068ff.entry.js → p-3a276f3d.entry.js} +1 -1
- package/dist/sankhyablocks/{p-31631fb6.entry.js → p-400cc777.entry.js} +1 -1
- package/dist/sankhyablocks/p-4392f13f.entry.js +1 -0
- package/dist/sankhyablocks/{p-ccdf59eb.entry.js → p-44ce5b90.entry.js} +1 -1
- package/dist/sankhyablocks/p-521c96f0.entry.js +1 -0
- package/dist/sankhyablocks/p-60eef7cd.entry.js +1 -0
- package/dist/sankhyablocks/{p-6c61416a.entry.js → p-6988f4a6.entry.js} +1 -1
- package/dist/sankhyablocks/p-9ba3df4c.js +2 -0
- package/dist/sankhyablocks/{p-cc85ba53.entry.js → p-9dc4426d.entry.js} +1 -1
- package/dist/sankhyablocks/{p-ee906940.entry.js → p-a17a4fca.entry.js} +1 -1
- package/dist/sankhyablocks/p-a5b26df2.js +1 -0
- package/dist/sankhyablocks/{p-f9084ecb.entry.js → p-cc4bef9f.entry.js} +1 -1
- package/dist/sankhyablocks/p-d690b6b5.entry.js +75 -0
- package/dist/sankhyablocks/{p-ad658f44.js → p-d9fbb26f.js} +1 -1
- package/dist/sankhyablocks/{p-857c4735.entry.js → p-deb1f523.entry.js} +1 -1
- package/dist/sankhyablocks/p-e871aa92.entry.js +1 -0
- package/dist/sankhyablocks/{p-04ad681a.entry.js → p-e9beab79.entry.js} +1 -1
- package/dist/sankhyablocks/p-eb23420d.entry.js +1 -0
- package/dist/sankhyablocks/p-f37cdeb5.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +4 -0
- package/dist/types/components/snk-form/subcomponents/snk-config-options/snk-config-options.d.ts +17 -7
- package/dist/types/components/snk-form/subcomponents/snk-field-config/snk-field-config.d.ts +6 -0
- package/dist/types/components.d.ts +12 -0
- package/dist/types/lib/http/data-fetcher/fetchers/parameters-fecher.d.ts +7 -7
- package/dist/types/lib/utils/constants.d.ts +14 -0
- package/package.json +5 -5
- package/dist/sankhyablocks/p-26c503a6.entry.js +0 -1
- package/dist/sankhyablocks/p-434e0dcf.entry.js +0 -1
- package/dist/sankhyablocks/p-9f2c5fac.entry.js +0 -1
- package/dist/sankhyablocks/p-ae302037.entry.js +0 -75
- package/dist/sankhyablocks/p-af11b0e7.js +0 -1
- package/dist/sankhyablocks/p-af306302.entry.js +0 -1
- package/dist/sankhyablocks/p-ce789145.entry.js +0 -1
- package/dist/sankhyablocks/p-cf81e313.entry.js +0 -1
- package/dist/sankhyablocks/p-ddb03141.js +0 -2
- package/dist/sankhyablocks/p-fa75fba5.entry.js +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import { ApplicationContext } from '@sankhyalabs/core';
|
|
3
|
-
import { formFieldBuilder } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
2
|
+
import { UserInterface, ObjectUtils, ApplicationContext } from '@sankhyalabs/core';
|
|
4
3
|
import { DataType, getConvertedValue } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
|
|
5
|
-
import {
|
|
4
|
+
import { CheckMode } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
5
|
+
import { a as VARS_BY_TYPE, D as DEFAULT_TYPE, T as TAGS_BY_TYPE } from './constants.js';
|
|
6
6
|
|
|
7
7
|
const snkConfigOptionsCss = ".sc-snk-config-options-h{width:100%;border:2px solid var(--color--secondary-200);border-radius:15px}.config-options__switch-row.sc-snk-config-options{margin-top:-30px}";
|
|
8
8
|
|
|
@@ -33,71 +33,20 @@ const SnkConfigOptions = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
33
33
|
enabledValueDefault() {
|
|
34
34
|
var _a, _b, _c;
|
|
35
35
|
const field = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getField((_b = this.fieldConfig) === null || _b === void 0 ? void 0 : _b.name);
|
|
36
|
-
|
|
36
|
+
const allowDefault = (_c = field === null || field === void 0 ? void 0 : field.properties) === null || _c === void 0 ? void 0 : _c.allowDefault;
|
|
37
|
+
const hasVariableVar = VARS_BY_TYPE.UserInterface.hasOwnProperty(field === null || field === void 0 ? void 0 : field.userInterface);
|
|
38
|
+
if ((allowDefault == undefined || allowDefault === "true") && hasVariableVar) {
|
|
37
39
|
return true;
|
|
38
40
|
}
|
|
39
41
|
return false;
|
|
40
42
|
}
|
|
41
|
-
|
|
42
|
-
var _a;
|
|
43
|
-
if (field != undefined) {
|
|
44
|
-
return (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getField(field);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
getMessage(key, params) {
|
|
48
|
-
return this._application.messagesBuilder.getMessage(key, params);
|
|
49
|
-
}
|
|
50
|
-
getDefaultType() {
|
|
51
|
-
var _a;
|
|
52
|
-
return (_a = this.fieldConfig.defaultValue.type) !== null && _a !== void 0 ? _a : DEFAULT_TYPE.fixed;
|
|
53
|
-
}
|
|
54
|
-
getValidatedValue(fieldValue) {
|
|
43
|
+
isAllowDefault() {
|
|
55
44
|
var _a, _b;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
const field = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getField((_b = this.fieldConfig) === null || _b === void 0 ? void 0 : _b.name);
|
|
60
|
-
const dataType = field === null || field === void 0 ? void 0 : field.dataType;
|
|
61
|
-
if (dataType == undefined) {
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
const value = dataType !== DataType.OBJECT && dataType !== DataType.DATE
|
|
65
|
-
&& typeof fieldValue === "object" && "value" in fieldValue
|
|
66
|
-
? fieldValue.value
|
|
67
|
-
: fieldValue;
|
|
68
|
-
return dataType === DataType.OBJECT ? JSON.stringify(value) : value;
|
|
69
|
-
}
|
|
70
|
-
onChange(evt) {
|
|
71
|
-
this.fieldConfig.defaultValue.value = this.getValidatedValue(evt === null || evt === void 0 ? void 0 : evt.detail);
|
|
72
|
-
this.configOptionsChanged.emit(this.fieldConfig);
|
|
73
|
-
}
|
|
74
|
-
onSearch(searchArgument) {
|
|
75
|
-
if (this._application != undefined && this.fieldConfig != undefined) {
|
|
76
|
-
return this._application.executeSearch(searchArgument, this.fieldConfig.name, this.dataUnit);
|
|
45
|
+
const allowDefault = (_b = (_a = this._fieldProperties) === null || _a === void 0 ? void 0 : _a.properties) === null || _b === void 0 ? void 0 : _b.allowDefault;
|
|
46
|
+
if (allowDefault == undefined) {
|
|
47
|
+
return true;
|
|
77
48
|
}
|
|
78
|
-
|
|
79
|
-
loadDataField() {
|
|
80
|
-
this._element.querySelectorAll("[data-field-name]")
|
|
81
|
-
.forEach((field) => {
|
|
82
|
-
var _a, _b, _c, _d;
|
|
83
|
-
field.enabled = ((_b = (_a = this._fieldProperties) === null || _a === void 0 ? void 0 : _a.properties) === null || _b === void 0 ? void 0 : _b.allowDefault) === "true";
|
|
84
|
-
if (field.enabled) {
|
|
85
|
-
const value = this.fieldConfig.defaultValue.value;
|
|
86
|
-
if (value != undefined) {
|
|
87
|
-
const fieldName = field.dataset.fieldName;
|
|
88
|
-
const dataType = (_d = (_c = this.dataUnit) === null || _c === void 0 ? void 0 : _c.getField(fieldName)) === null || _d === void 0 ? void 0 : _d.dataType;
|
|
89
|
-
field.value = getConvertedValue(dataType, value);
|
|
90
|
-
}
|
|
91
|
-
field.addEventListener(CONFIG_EVENTS.fieldChanged, (evt) => {
|
|
92
|
-
return this.onChange(evt);
|
|
93
|
-
});
|
|
94
|
-
if (field.tagName === "EZ-SEARCH") {
|
|
95
|
-
field.optionLoader = (searchArgument) => {
|
|
96
|
-
return this.onSearch(searchArgument);
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
});
|
|
49
|
+
return allowDefault === "true";
|
|
101
50
|
}
|
|
102
51
|
loadDefaultValue() {
|
|
103
52
|
var _a;
|
|
@@ -119,6 +68,19 @@ const SnkConfigOptions = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
119
68
|
this._defaultType = this.fieldConfig.defaultValue.type;
|
|
120
69
|
}
|
|
121
70
|
}
|
|
71
|
+
getFieldProperties(field) {
|
|
72
|
+
var _a;
|
|
73
|
+
if (field != undefined) {
|
|
74
|
+
return (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getField(field);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
getMessage(key, params) {
|
|
78
|
+
return this._application.messagesBuilder.getMessage(key, params);
|
|
79
|
+
}
|
|
80
|
+
getDefaultType() {
|
|
81
|
+
var _a;
|
|
82
|
+
return (_a = this.fieldConfig.defaultValue.type) !== null && _a !== void 0 ? _a : DEFAULT_TYPE.fixed;
|
|
83
|
+
}
|
|
122
84
|
getEnabledByProperty(property) {
|
|
123
85
|
const properties = this._fieldProperties;
|
|
124
86
|
if (properties != undefined && properties[property] === true) {
|
|
@@ -133,25 +95,130 @@ const SnkConfigOptions = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
133
95
|
}
|
|
134
96
|
return this.fieldConfig[property];
|
|
135
97
|
}
|
|
98
|
+
getValidatedValue(fieldValue) {
|
|
99
|
+
var _a, _b;
|
|
100
|
+
if (fieldValue == undefined) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
const field = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getField((_b = this.fieldConfig) === null || _b === void 0 ? void 0 : _b.name);
|
|
104
|
+
const dataType = field === null || field === void 0 ? void 0 : field.dataType;
|
|
105
|
+
if (dataType == undefined) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
const value = (fieldValue === null || fieldValue === void 0 ? void 0 : fieldValue.waitmessage) != undefined ? undefined :
|
|
109
|
+
dataType !== DataType.OBJECT && dataType !== DataType.DATE
|
|
110
|
+
&& typeof fieldValue === "object"
|
|
111
|
+
? fieldValue.value
|
|
112
|
+
: fieldValue;
|
|
113
|
+
return dataType === DataType.OBJECT ? JSON.stringify(value) : value;
|
|
114
|
+
}
|
|
115
|
+
buildInputDefault({ value, enabled, label, name, required, userInterface }, properties = undefined, mode = undefined) {
|
|
116
|
+
let options;
|
|
117
|
+
let precision = 0;
|
|
118
|
+
let prettyPrecision = 0;
|
|
119
|
+
const TagName = userInterface == undefined || TAGS_BY_TYPE[userInterface] == undefined
|
|
120
|
+
? TAGS_BY_TYPE.DEFAULT
|
|
121
|
+
: TAGS_BY_TYPE[userInterface];
|
|
122
|
+
if (userInterface === UserInterface.OPTIONSELECTOR) {
|
|
123
|
+
const prop = properties === null || properties === void 0 ? void 0 : properties.options;
|
|
124
|
+
if (typeof prop === "string") {
|
|
125
|
+
const parsed = ObjectUtils.stringToObject(prop);
|
|
126
|
+
options = Object.keys(parsed).map(key => { return { value: key, label: parsed[key] }; });
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
options = prop;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
else if (userInterface === UserInterface.DECIMALNUMBER) {
|
|
133
|
+
precision = Number((properties === null || properties === void 0 ? void 0 : properties.precision) || 2);
|
|
134
|
+
prettyPrecision = Number((properties === null || properties === void 0 ? void 0 : properties.prettyPrecision) || precision);
|
|
135
|
+
}
|
|
136
|
+
return h(TagName, Object.assign({ value: value, enabled: enabled, label: label, "data-field-name": name, key: name, onEzChange: (evt) => this.onChange(evt === null || evt === void 0 ? void 0 : evt.detail) }, (this.getConditionalAttributes(userInterface, required, options, precision, prettyPrecision, mode))));
|
|
137
|
+
}
|
|
138
|
+
getConditionalAttributes(userInterface, required, options, precision, prettyPrecision, mode) {
|
|
139
|
+
switch (userInterface) {
|
|
140
|
+
case UserInterface.SEARCH:
|
|
141
|
+
return {
|
|
142
|
+
suppressEmptyOption: required,
|
|
143
|
+
optionLoader: (searchArgument) => this.onSearch(searchArgument)
|
|
144
|
+
};
|
|
145
|
+
case UserInterface.OPTIONSELECTOR:
|
|
146
|
+
return {
|
|
147
|
+
suppressEmptyOption: required,
|
|
148
|
+
options
|
|
149
|
+
};
|
|
150
|
+
case UserInterface.CHECKBOX:
|
|
151
|
+
case UserInterface.SWITCH:
|
|
152
|
+
return {
|
|
153
|
+
mode
|
|
154
|
+
};
|
|
155
|
+
case UserInterface.INTEGERNUMBER:
|
|
156
|
+
case UserInterface.DECIMALNUMBER:
|
|
157
|
+
return {
|
|
158
|
+
precision,
|
|
159
|
+
prettyPrecision,
|
|
160
|
+
onEzStartChange: (evt) => this.onChange(evt === null || evt === void 0 ? void 0 : evt.detail)
|
|
161
|
+
};
|
|
162
|
+
case UserInterface.DATE:
|
|
163
|
+
case UserInterface.DATETIME:
|
|
164
|
+
case UserInterface.TIME:
|
|
165
|
+
return {
|
|
166
|
+
onEzStartChange: (evt) => this.onChange(evt === null || evt === void 0 ? void 0 : evt.detail)
|
|
167
|
+
};
|
|
168
|
+
default:
|
|
169
|
+
return {};
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
onChange(fieldValue) {
|
|
173
|
+
this.fieldConfig.defaultValue.value = this.getValidatedValue(fieldValue);
|
|
174
|
+
this.configOptionsChanged.emit(this.fieldConfig);
|
|
175
|
+
}
|
|
176
|
+
onSearch(searchArgument) {
|
|
177
|
+
if (this._application != undefined && this.fieldConfig != undefined) {
|
|
178
|
+
return this._application.executeSearch(searchArgument, this.fieldConfig.name, this.dataUnit);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
buildField(field) {
|
|
182
|
+
const { config, descriptor } = field;
|
|
183
|
+
const { name, label, readOnly, required, defaultValue } = config;
|
|
184
|
+
const { userInterface, properties } = descriptor;
|
|
185
|
+
const enabled = (properties === null || properties === void 0 ? void 0 : properties.allowDefault) != undefined ? properties.allowDefault === "true" : !readOnly;
|
|
186
|
+
let value;
|
|
187
|
+
if (enabled) {
|
|
188
|
+
value = defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.value;
|
|
189
|
+
if (value != undefined) {
|
|
190
|
+
value = getConvertedValue(descriptor === null || descriptor === void 0 ? void 0 : descriptor.dataType, value);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
const configField = { value, enabled, label, name, required, userInterface };
|
|
194
|
+
switch (userInterface) {
|
|
195
|
+
case UserInterface.SWITCH:
|
|
196
|
+
return this.buildInputDefault(configField, undefined, CheckMode.SWITCH);
|
|
197
|
+
case UserInterface.CHECKBOX:
|
|
198
|
+
return this.buildInputDefault(configField, undefined, CheckMode.REGULAR);
|
|
199
|
+
case UserInterface.OPTIONSELECTOR:
|
|
200
|
+
case UserInterface.DECIMALNUMBER:
|
|
201
|
+
return this.buildInputDefault(configField, properties);
|
|
202
|
+
default:
|
|
203
|
+
return this.buildInputDefault(configField);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
136
206
|
componentWillLoad() {
|
|
137
207
|
var _a;
|
|
138
|
-
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
139
208
|
this.loadDefaultValue();
|
|
209
|
+
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
140
210
|
this._fieldProperties = this.getFieldProperties((_a = this.fieldConfig) === null || _a === void 0 ? void 0 : _a.name);
|
|
141
211
|
}
|
|
142
|
-
componentDidRender() {
|
|
143
|
-
this.loadDataField();
|
|
144
|
-
}
|
|
145
212
|
render() {
|
|
146
|
-
var _a, _b
|
|
147
|
-
return (h(Host, null, h("div", { id: this.idConfig }, h("div", { class: "ez-row ez-padding--medium" }, h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small" }, h("ez-text-input", { label: this.getMessage("snkConfigOptions.label.nameField"), value: (_a = this.fieldConfig) === null || _a === void 0 ? void 0 : _a.label, onEzChange: (evt) => { this.fieldConfig.label = evt.detail; this.configOptionsChanged.emit(this.fieldConfig); } })), h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small" }, h("ez-combo-box", { label: this.getMessage("snkConfigOptions.label.typeValueDefault"), suppressEmptyOption: true, enabled:
|
|
148
|
-
h("ez-combo-box", { label: this.getMessage("snkConfigOptions.label.valueDefault"), enabled: this.
|
|
213
|
+
var _a, _b;
|
|
214
|
+
return (h(Host, null, h("div", { id: this.idConfig }, h("div", { class: "ez-row ez-padding--medium" }, h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small" }, h("ez-text-input", { label: this.getMessage("snkConfigOptions.label.nameField"), value: (_a = this.fieldConfig) === null || _a === void 0 ? void 0 : _a.label, onEzChange: (evt) => { this.fieldConfig.label = evt.detail; this.configOptionsChanged.emit(this.fieldConfig); } })), h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small" }, h("ez-combo-box", { label: this.getMessage("snkConfigOptions.label.typeValueDefault"), suppressEmptyOption: true, enabled: this.enabledValueDefault(), onEzChange: (evt) => { var _a; return this.onConfigDefault((_a = evt.detail) === null || _a === void 0 ? void 0 : _a.value); }, value: this.getDefaultType() }, h("option", { value: DEFAULT_TYPE.fixed }, this.getMessage("snkConfigOptions.options.valueFixed")), h("option", { value: DEFAULT_TYPE.variable }, this.getMessage("snkConfigOptions.options.variable")))), h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small" }, this._defaultType === DEFAULT_TYPE.variable ?
|
|
215
|
+
h("ez-combo-box", { label: this.getMessage("snkConfigOptions.label.valueDefault"), enabled: this.isAllowDefault(), onEzChange: (evt) => { var _a; this.fieldConfig.defaultValue.value = (_a = evt.detail) === null || _a === void 0 ? void 0 : _a.value; this.configOptionsChanged.emit(this.fieldConfig); }, value: this.fieldConfig.defaultValue.value, options: this.buildOptions() })
|
|
149
216
|
:
|
|
150
|
-
((
|
|
151
|
-
|
|
217
|
+
((_b = this._fieldProperties) === null || _b === void 0 ? void 0 : _b.userInterface) &&
|
|
218
|
+
this.buildField({
|
|
152
219
|
descriptor: this._fieldProperties,
|
|
153
220
|
config: this.fieldConfig
|
|
154
|
-
})
|
|
221
|
+
}))), h("div", { class: "ez-row ez-padding--medium config-options__switch-row" }, h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small" }, h("ez-check", { mode: CheckMode.SWITCH, label: this.getMessage("snkConfigOptions.label.clearDuplicate"), value: this.fieldConfig.cleanOnCopy, onEzChange: (evt) => { this.fieldConfig.cleanOnCopy = evt.detail; this.configOptionsChanged.emit(this.fieldConfig); } })), h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small" }, h("ez-check", { mode: CheckMode.SWITCH, label: this.getMessage("snkConfigOptions.label.requiredField"), enabled: this.getEnabledByProperty("required"), value: this.getValueByProperty("required"), onEzChange: (evt) => { this.fieldConfig.required = evt.detail; this.configOptionsChanged.emit(this.fieldConfig); } })), h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small" }, h("ez-check", { mode: CheckMode.SWITCH, label: this.getMessage("snkConfigOptions.label.protectedField"), enabled: this.getEnabledByProperty("readOnly"), value: this.getValueByProperty("readOnly"), onEzChange: (evt) => { this.fieldConfig.readOnly = evt.detail; this.configOptionsChanged.emit(this.fieldConfig); } }))))));
|
|
155
222
|
}
|
|
156
223
|
get _element() { return this; }
|
|
157
224
|
static get style() { return snkConfigOptionsCss; }
|
|
@@ -177,7 +177,7 @@ const SnkDataUnit$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
177
177
|
}
|
|
178
178
|
else {
|
|
179
179
|
const removeConfirmationTitle = this.getMessage("snkDataUnit.removeConfirmationTitle");
|
|
180
|
-
ApplicationUtils.confirm(removeConfirmationTitle, removeConfirmation, "delete", DialogType.
|
|
180
|
+
ApplicationUtils.confirm(removeConfirmationTitle, removeConfirmation, "delete", DialogType.WARN)
|
|
181
181
|
.then((result) => resolve(result ? action : undefined));
|
|
182
182
|
}
|
|
183
183
|
}
|
|
@@ -36,6 +36,11 @@ const SnkFieldConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
36
36
|
getMessage(key) {
|
|
37
37
|
return this._application.messagesBuilder.getMessage(key, {});
|
|
38
38
|
}
|
|
39
|
+
isRequired() {
|
|
40
|
+
var _a, _b;
|
|
41
|
+
const fieldMD = this.dataUnit && this.dataUnit.getField((_a = this.fieldConfig) === null || _a === void 0 ? void 0 : _a.name);
|
|
42
|
+
return (fieldMD === null || fieldMD === void 0 ? void 0 : fieldMD.required) === true || ((_b = this.fieldConfig) === null || _b === void 0 ? void 0 : _b.required) === true;
|
|
43
|
+
}
|
|
39
44
|
componentWillLoad() {
|
|
40
45
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
41
46
|
}
|
|
@@ -43,7 +48,7 @@ const SnkFieldConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
43
48
|
if (this.fieldConfig == undefined) {
|
|
44
49
|
return;
|
|
45
50
|
}
|
|
46
|
-
return (h(Host, null, h("div", { class: "field-config" }, h("div", { class: "field-config__draggable" }, h("ez-icon", { iconName: "drag-indicator", size: "small" })), h("div", null, this.fieldConfig.label, this.
|
|
51
|
+
return (h(Host, null, h("div", { class: "field-config" }, h("div", { class: "field-config__draggable" }, h("ez-icon", { iconName: "drag-indicator", size: "small" })), h("div", null, this.fieldConfig.label, this.isRequired() && h("span", { class: "field-config__required-label" }, "*")), this.modeInsertion ?
|
|
47
52
|
h("div", { class: "field-config__add" }, h("ez-button", { onClick: (evt) => this.handleAction(evt, ACTION_CONFIG.add), mode: "icon", class: "ez-button--tertiary", iconName: "plus", size: "large", title: this.getMessage("snkFieldConfig.titleAdd") })) :
|
|
48
53
|
h("div", { class: "field-config__options" + (this.isConfigActive ? " field-config__options--is-active" : " ") }, h("ez-button", { mode: "icon", class: "ez-button--tertiary field-config__remove-icon", onClick: (evt) => this.handleAction(evt, ACTION_CONFIG.remove), iconName: "minus", size: "large", title: this.getMessage("snkFieldConfig.titleRemove") }), h("ez-button", { id: "buttonConfig_" + this.fieldConfig.name, mode: "icon", class: "ez-button--tertiary", onClick: (evt) => this.handleAction(evt, ACTION_CONFIG.configuration), iconName: this.isConfigActive ? "chevron-up" : "settings-inverted", size: "large", title: this.getMessage("snkFieldConfig.titleConfigurations") }))), this.isConfigActive && h("div", { class: "field-config__config-popover" }, h("div", { class: "field-config__config-outer-arrow" }, h("div", { class: "field-config__config-inner-arrow" })))));
|
|
49
54
|
}
|
|
@@ -51,7 +56,8 @@ const SnkFieldConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
51
56
|
}, [2, "snk-field-config", {
|
|
52
57
|
"isConfigActive": [16],
|
|
53
58
|
"fieldConfig": [16],
|
|
54
|
-
"modeInsertion": [516, "mode-insertion"]
|
|
59
|
+
"modeInsertion": [516, "mode-insertion"],
|
|
60
|
+
"dataUnit": [16]
|
|
55
61
|
}]);
|
|
56
62
|
function defineCustomElement() {
|
|
57
63
|
if (typeof customElements === "undefined") {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
2
|
import { ModalAction, ModalButtonStatus } from '@sankhyalabs/ezui/dist/collection/components/ez-modal-container';
|
|
3
3
|
import { ArrayUtils } from '@sankhyalabs/core';
|
|
4
|
+
import { CheckMode } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
4
5
|
|
|
5
6
|
const SnkFilterModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
6
7
|
constructor() {
|
|
@@ -9,7 +10,7 @@ const SnkFilterModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
9
10
|
}
|
|
10
11
|
updateValue(id, value = undefined) {
|
|
11
12
|
this.items = this.items.map(item => {
|
|
12
|
-
if (item.id === id) {
|
|
13
|
+
if (item.id === id && item.enabled) {
|
|
13
14
|
if (value == undefined) {
|
|
14
15
|
value = !item.active;
|
|
15
16
|
}
|
|
@@ -27,7 +28,7 @@ const SnkFilterModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
27
28
|
}
|
|
28
29
|
buildItems(list) {
|
|
29
30
|
return list.map(item => {
|
|
30
|
-
return (h("button", { onClick: () => this.updateValue(item.id), class: "ez-padding--medium sc-snk-filter-bar snk-filter-bar__filter-modal-item ez-align--middle ez-margin-bottom--small" }, h("ez-check", { id: `checkbox_${item.id}`, tabIndex: "-1", class: "sc-snk-filter-bar snk-filter-bar__filter-modal-item__check", onEzChange: evt => this.updateValue(item.id, evt.detail), enabled: item.enabled, value: item.active, mode:
|
|
31
|
+
return (h("button", { onClick: () => this.updateValue(item.id), class: "ez-padding--medium sc-snk-filter-bar snk-filter-bar__filter-modal-item ez-align--middle ez-margin-bottom--small" }, h("ez-check", { id: `checkbox_${item.id}`, tabIndex: "-1", class: "sc-snk-filter-bar snk-filter-bar__filter-modal-item__check", onEzChange: evt => this.updateValue(item.id, evt.detail), enabled: item.enabled, value: item.active, mode: CheckMode.SWITCH }), h("div", { class: "ez-text ez-title--primary ez-text--medium ez-margin-left--medium sc-snk-filter-bar snk-filter-bar__filter-modal-item__label" }, item.label)));
|
|
31
32
|
});
|
|
32
33
|
}
|
|
33
34
|
itemKeyBoardSelect(event, item) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { UserInterface, ApplicationContext } from '@sankhyalabs/core';
|
|
3
3
|
import { convertType } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
|
|
4
|
+
import { CheckMode } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
4
5
|
import { F as FilterItemType } from './filter-item-type.enum.js';
|
|
5
6
|
|
|
6
7
|
const SnkFilterPersonalized$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
@@ -52,7 +53,7 @@ const SnkFilterPersonalized$1 = /*@__PURE__*/ proxyCustomElement(class extends H
|
|
|
52
53
|
return h("ez-search", { id: elemId, suppressEmptyOption: true, value: this.getValue(param, index), onEzChange: evt => this.setValue(index, evt.detail), label: param.label, optionLoader: ({ mode, argument }) => this.doSearch(mode, argument, param) });
|
|
53
54
|
case UserInterface.SWITCH:
|
|
54
55
|
case UserInterface.CHECKBOX:
|
|
55
|
-
const mode = UserInterface.SWITCH === param.type ?
|
|
56
|
+
const mode = UserInterface.SWITCH === param.type ? CheckMode.SWITCH : CheckMode.REGULAR;
|
|
56
57
|
return h("ez-check", { id: elemId, class: "ez-padding-bottom--medium", mode: mode, value: this.getValue(param, index), label: param.label, onEzChange: evt => this.setValue(index, evt.detail) });
|
|
57
58
|
case UserInterface.DECIMALNUMBER:
|
|
58
59
|
case UserInterface.INTEGERNUMBER:
|
|
@@ -2,12 +2,12 @@ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/
|
|
|
2
2
|
import { a as draggable_bundle, d as defineCustomElement$1 } from './snk-tab-config2.js';
|
|
3
3
|
import { ObjectUtils, ArrayUtils, ApplicationContext } from '@sankhyalabs/core';
|
|
4
4
|
import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
5
|
-
import { C as CONFIG_EVENTS,
|
|
5
|
+
import { C as CONFIG_EVENTS, b as TAB_NAMES, A as ACTION_CONFIG, D as DEFAULT_TYPE } from './constants.js';
|
|
6
6
|
import { a as UserConfigType } from './form-config-fetcher.js';
|
|
7
7
|
import { d as defineCustomElement$3 } from './snk-config-options2.js';
|
|
8
8
|
import { d as defineCustomElement$2 } from './snk-field-config2.js';
|
|
9
9
|
|
|
10
|
-
const snkFormConfigCss = ".sc-snk-form-config-h{--snk-form-config__title--font-pattern:var(--font-pattern, \"
|
|
10
|
+
const snkFormConfigCss = ".sc-snk-form-config-h{--snk-form-config__title--font-pattern:var(--font-pattern, \"Roboto\");--snk-form-config__title--weight--large:var(--text-weight--large, 600);display:flex;flex-direction:column;position:absolute;top:0;left:0;width:100%;height:100%;z-index:var(--more-visible, 2);background-color:var(--background--xlight)}.form-config__title.sc-snk-form-config{display:flex;margin:0;line-height:1.3;font-family:var(--snk-form-config__title--font-pattern);font-weight:var(--snk-form-config__title--weight--large)}.form-config__header-container.sc-snk-form-config{display:flex}.form-config__field-container.sc-snk-form-config{width:32%;padding:6px}.form-config__hide-content.sc-snk-form-config{display:none}ez-icon.sc-snk-form-config .left-icon.sc-snk-form-config{--ez-icon--color:var(--text--disable)}.ez-box__label-counter.sc-snk-form-config{font-weight:var(--text-weight--extra-small);margin-top:-7px}.form-config__btn-options.sc-snk-form-config{--ez-button--min-width:300px;--ez-button--background-color:#FFFFFF}[data-draggable-parent].sc-snk-form-config{position:relative}.form-config__field-config--selected.sc-snk-form-config{position:static}.form-config__field-config--dragged.sc-snk-form-config .draggable-mirror.sc-snk-form-config{z-index:var(--more-visible, 2)}.form-config__config-options.sc-snk-form-config{position:relative;margin-top:-3px;min-width:100%;z-index:1}.form-config__tab-container.sc-snk-form-config,.form-config__fields-available.sc-snk-form-config{position:relative;height:100%;max-height:calc(100vh - 92px)}.form-config__tab-container.sc-snk-form-config .ez-box__container.sc-snk-form-config,.form-config__fields-available.sc-snk-form-config .ez-box__container.sc-snk-form-config{align-content:flex-start;height:100%}.form-config__fields-available.sc-snk-form-config [data-draggable-parent].sc-snk-form-config{align-content:flex-start;overflow-y:auto;height:100%;max-height:calc(100% - 122px)}.form-config__tab-content.sc-snk-form-config{align-content:flex-start;overflow-y:auto;height:auto;max-height:calc(100% - 128px)}[data-draggable-element].sc-snk-form-config{cursor:grab}.form-config__actions-button.sc-snk-form-config{--ez-actions-button__btn-action--min-width:250px}.form-config__add-group.sc-snk-form-config{position:relative;min-height:120px;margin-bottom:10px}.form-config__add-group-container.sc-snk-form-config{position:absolute;display:flex;flex-wrap:wrap;width:100%;box-sizing:border-box;border-radius:var(--border--radius-medium, 12px);background-color:var(--background--medium, #d2dce9);padding:var(--space--small, 6px)}.form-config__add-group-content.sc-snk-form-config{width:100%;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;box-sizing:border-box;border:2px dashed var(--color-strokes, #DCE0E8);border-radius:var(--border--radius-small, 6px)}.form-config__add-group-label.sc-snk-form-config{display:flex;justify-content:center;box-sizing:border-box;padding:var(--space--large, 24px)}.form-config__btn-add-group.sc-snk-form-config{position:relative;padding:var(--space--large, 24px) var(--space--medium, 12px) 0}.form-config__btn-add-group-container.sc-snk-form-config{padding:var(--space--medium, 12px);border-radius:var(--border--radius-medium, 12px);border:2px solid var(--color-strokes, #DCE0E8);background-color:var(--background--body, #fafcff)}.form-config__left-icon--eye-off.sc-snk-form-config{padding-top:var(--space--medium, 8px)}ez-collapsible-box.draggable-mirror.sc-snk-form-config{display:table;background-color:#FFFFFF}ez-collapsible-box.sc-snk-form-config{margin-bottom:10px}@media screen and (min-width: 480px){.form-config__field-config--selected.sc-snk-form-config .ez-flex.form-config__config-options.sc-snk-form-config{min-width:calc(300% + 12px)}.form-config__field-config--selected.sc-snk-form-config:nth-child(3n+2) .ez-flex.form-config__config-options.sc-snk-form-config{transform:translate(calc(100% / 3 * -1))}.form-config__field-config--selected.sc-snk-form-config:nth-child(3n+3) .ez-flex.form-config__config-options.sc-snk-form-config{transform:translate(calc(100% / 3 * -2))}}";
|
|
11
11
|
|
|
12
12
|
const CONTAINER_ID = {
|
|
13
13
|
collapsibleBox: "EZ-COLLAPSIBLE-BOX",
|
|
@@ -129,19 +129,30 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
129
129
|
const snkFieldConfigs = this._formContainer.querySelectorAll('snk-field-config');
|
|
130
130
|
snkFieldConfigs.forEach((snkField) => {
|
|
131
131
|
const fieldConfig = snkField.fieldConfig;
|
|
132
|
-
if (fieldConfig) {
|
|
133
|
-
|
|
134
|
-
cleanOnCopy: fieldConfig.cleanOnCopy || false,
|
|
135
|
-
group: fieldConfig.group,
|
|
136
|
-
label: fieldConfig.label,
|
|
137
|
-
name: fieldConfig.name,
|
|
138
|
-
required: fieldConfig.required,
|
|
139
|
-
readOnly: fieldConfig.readOnly,
|
|
140
|
-
tab: fieldConfig.tab,
|
|
141
|
-
defaultValue: fieldConfig.defaultValue
|
|
142
|
-
};
|
|
143
|
-
fields.push(fieldToSave);
|
|
132
|
+
if (fieldConfig == undefined) {
|
|
133
|
+
return;
|
|
144
134
|
}
|
|
135
|
+
const fieldToSave = {
|
|
136
|
+
cleanOnCopy: fieldConfig.cleanOnCopy || false,
|
|
137
|
+
group: fieldConfig.group,
|
|
138
|
+
label: fieldConfig.label,
|
|
139
|
+
name: fieldConfig.name,
|
|
140
|
+
required: fieldConfig.required,
|
|
141
|
+
readOnly: fieldConfig.readOnly,
|
|
142
|
+
tab: fieldConfig.tab
|
|
143
|
+
};
|
|
144
|
+
if (fieldConfig.defaultValue != undefined) {
|
|
145
|
+
if (fieldConfig.defaultValue.type == undefined) {
|
|
146
|
+
fieldToSave.defaultValue = {
|
|
147
|
+
type: DEFAULT_TYPE.fixed,
|
|
148
|
+
value: fieldConfig.defaultValue
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
fieldToSave.defaultValue = fieldConfig.defaultValue;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
fields.push(fieldToSave);
|
|
145
156
|
});
|
|
146
157
|
return fields;
|
|
147
158
|
}
|
|
@@ -218,8 +229,8 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
218
229
|
var _a;
|
|
219
230
|
return ((_a = group.fields) === null || _a === void 0 ? void 0 : _a.length) ? group.fields.map((field) => {
|
|
220
231
|
var _a, _b;
|
|
221
|
-
return h("div", { key: field.name, class: this.getFieldConfigStyle(field), "data-draggable-element": "field", onMouseDown: (evt) => this.controlMoveField(evt) }, h("snk-field-config", { onEzClickIcon: (evt) => { this.handleFieldConfigChange(evt); }, modeInsertion: false, fieldConfig: field, isConfigActive: ((_a = this._fieldConfigSelected) === null || _a === void 0 ? void 0 : _a.name) === field.name }), ((_b = this._fieldConfigSelected) === null || _b === void 0 ? void 0 : _b.name) === field.name &&
|
|
222
|
-
h("div", { class: "ez-flex form-config__config-options" }, h("snk-config-options", { idConfig: field.name, dataUnit: this.dataUnit, fieldConfig: this._fieldConfigSelected, onConfigOptionsChanged: (
|
|
232
|
+
return h("div", { key: field.name, class: this.getFieldConfigStyle(field), "data-draggable-element": "field", onMouseDown: (evt) => this.controlMoveField(evt) }, h("snk-field-config", { onEzClickIcon: (evt) => { this.handleFieldConfigChange(evt); }, modeInsertion: false, fieldConfig: field, dataUnit: this.dataUnit, isConfigActive: ((_a = this._fieldConfigSelected) === null || _a === void 0 ? void 0 : _a.name) === field.name }), ((_b = this._fieldConfigSelected) === null || _b === void 0 ? void 0 : _b.name) === field.name &&
|
|
233
|
+
h("div", { class: "ez-flex form-config__config-options" }, h("snk-config-options", { idConfig: field.name, dataUnit: this.dataUnit, fieldConfig: this._fieldConfigSelected, onConfigOptionsChanged: (evt) => this.handleconfigOptionsChanged(evt.detail) })));
|
|
223
234
|
}) : h("div", { class: "form-config__add-group-container" }, h("div", { class: "form-config__add-group-content" }, h("div", { class: "form-config__add-group-label" }, h("label", { class: "ez-text ez-text--center ez-text--medium ez-text--primary ez-text--bold" }, this.getMessage("snkFormConfig.form.labelDropField")))));
|
|
224
235
|
}
|
|
225
236
|
handleconfigOptionsChanged(fieldEdited) {
|
|
@@ -944,7 +955,7 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
944
955
|
return h("div", { class: "ez-flex ez-flex--column ez-size-width--full" }, h("label", { class: "ez-text ez-text--secondary ez-margin-vertical--small" }, this.getMessage("snkFormConfig.form.subTitleInfo")), h("div", { id: CONTAINER_ID.withoutGroup, class: "ez-row", "data-draggable-parent": "field" }, this.getFieldsByGroup(group)), h("hr", { class: "ez-divider-horizontal ez-margin-vertical--medium" }));
|
|
945
956
|
}
|
|
946
957
|
}), this.renderTempGroupByTab(tab.tab))), h("div", { class: "form-config__btn-add-group ez-row" }, h("div", { class: "form-config__btn-add-group-container ez-col ez-col--sd-12 ez-col--tb-12 ez-align--center" }, h("ez-button", { label: this.getMessage("snkFormConfig.form.labelNewGroup"), class: "ez-padding-horizontal--small ez-button--primary", size: "small", onClick: () => this.addNewGroup() }, h("ez-icon", { class: "ez-margin-right--small", slot: "leftIcon", iconName: "plus" })))))), h("div", { class: "form-config__fields-available ez-col ez-col--sd-3 ez-col--tb-3" }, h("section", { class: "ez-box__container ez-col ez-col--pn-12" }, h("h1", { class: "ez-title ez-title--large ez-title--primary ez-padding-bottom--medium" }, this.getMessage("snkFormConfig.availableFields.title")), h("ez-filter-input", { ref: ref => this._filterFieldsAvailable = ref, label: this.getMessage("snkFormConfig.availableFields.labelSearchField"), onEzChange: evt => this.onFilterChange(evt.detail) }), h("span", { class: "ez-box__label-counter ez-text ez-text--medium ez-text--primary ez-margin-bottom--medium" }, this.handleLabelCounter((_c = this._fieldsAvailable) === null || _c === void 0 ? void 0 : _c.length)), ((_d = this._layoutFormConfig) === null || _d === void 0 ? void 0 : _d.length) > 0 &&
|
|
947
|
-
h("div", { id: CONTAINER_ID.fieldsAvailable, class: "ez-row", "data-draggable-parent": "field" }, this.orderFieldsAvailable(this._fieldsAvailable).map((field) => h("div", { key: field.name, class: this._fieldsAvailableStyle, "data-draggable-element": "field", onMouseDown: (evt) => this.controlMoveField(evt) }, h("snk-field-config", { onEzClickIcon: (evt) => { this.handleFieldConfigChange(evt); }, fieldConfig: field })))))))));
|
|
958
|
+
h("div", { id: CONTAINER_ID.fieldsAvailable, class: "ez-row", "data-draggable-parent": "field" }, this.orderFieldsAvailable(this._fieldsAvailable).map((field) => h("div", { key: field.name, class: this._fieldsAvailableStyle, "data-draggable-element": "field", onMouseDown: (evt) => this.controlMoveField(evt) }, h("snk-field-config", { onEzClickIcon: (evt) => { this.handleFieldConfigChange(evt); }, dataUnit: this.dataUnit, fieldConfig: field })))))))));
|
|
948
959
|
}
|
|
949
960
|
static get watchers() { return {
|
|
950
961
|
"formConfig": ["observeFormConfig"]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement as HTMLElement$1, createEvent, h, Host, Fragment } from '@stencil/core/internal/client';
|
|
2
2
|
import { c as createCommonjsModule } from './_commonjsHelpers.js';
|
|
3
3
|
import { ApplicationContext } from '@sankhyalabs/core';
|
|
4
|
-
import { C as CONFIG_EVENTS, K as KEY_EVENTS,
|
|
4
|
+
import { C as CONFIG_EVENTS, K as KEY_EVENTS, c as TYPE_ACTIONS, b as TAB_NAMES } from './constants.js';
|
|
5
5
|
|
|
6
6
|
var draggable_bundle = createCommonjsModule(function (module, exports) {
|
|
7
7
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
@@ -6884,7 +6884,7 @@ exports.Plugins = Plugins;
|
|
|
6884
6884
|
});
|
|
6885
6885
|
});
|
|
6886
6886
|
|
|
6887
|
-
const snkTabConfigCss = "@keyframes activate{0%{clip-path:inset(calc(100% - 3px) 50% 0px 50%)}100%{clip-path:inset(calc(100% - 3px) 0px 0px 0px)}}.sc-snk-tab-config-h{--snk-tab-config--backward-icon:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"10px\"><path d=\"M 9.7808475,13.860393 3.9204526,8.0000004 9.7808475,2.0624965 7.9301965,0.28895552 0.21915255,8.0000004 7.9301965,15.711044 Z\"/></svg>');--snk-tab-config--forward-icon:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"10px\"><path d=\"M 0.21915251,13.860393 6.0795475,8.0000007 0.21915251,2.0624968 2.0698036,0.28895588 9.7808475,8.0000007 2.0698036,15.711044 Z\"/></svg>');display:flex;position:relative;width:100%;overflow:hidden}.tab-config__scroll.sc-snk-tab-config{display:flex;width:100%;scroll-behavior:smooth;overflow-x:auto;scrollbar-width:none}.tab-config__scroll--start-hidden.sc-snk-tab-config{-webkit-mask-image:linear-gradient(90deg, transparent 20px, #000 48px)}.tab-config__scroll--middle.sc-snk-tab-config{-webkit-mask-image:linear-gradient(90deg, transparent 20px, #000 48px, #000 calc(100% - 48px), transparent calc(100% - 20px))}.tab-config__scroll--end-hidden.sc-snk-tab-config{-webkit-mask-image:linear-gradient(90deg, #000 calc(100% - 48px), transparent calc(100% - 20px))}.tab-config__lower-bar.sc-snk-tab-config{position:absolute;left:0%;right:0%;top:91%;bottom:0%;border-radius:2px;background:var(--color--disable-primary);border:2px solid var(--color--disable-primary)}.tab-config__tab.sc-snk-tab-config{display:flex;border:none;background-color:unset;cursor:pointer;align-items:center;justify-content:center;min-width:fit-content;color:var(--text--primary, #626e82);font-family:var(--font-pattern, \"
|
|
6887
|
+
const snkTabConfigCss = "@keyframes activate{0%{clip-path:inset(calc(100% - 3px) 50% 0px 50%)}100%{clip-path:inset(calc(100% - 3px) 0px 0px 0px)}}.sc-snk-tab-config-h{--snk-tab-config--backward-icon:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"10px\"><path d=\"M 9.7808475,13.860393 3.9204526,8.0000004 9.7808475,2.0624965 7.9301965,0.28895552 0.21915255,8.0000004 7.9301965,15.711044 Z\"/></svg>');--snk-tab-config--forward-icon:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"10px\"><path d=\"M 0.21915251,13.860393 6.0795475,8.0000007 0.21915251,2.0624968 2.0698036,0.28895588 9.7808475,8.0000007 2.0698036,15.711044 Z\"/></svg>');display:flex;position:relative;width:100%;overflow:hidden}.tab-config__scroll.sc-snk-tab-config{display:flex;width:100%;scroll-behavior:smooth;overflow-x:auto;scrollbar-width:none}.tab-config__scroll--start-hidden.sc-snk-tab-config{-webkit-mask-image:linear-gradient(90deg, transparent 20px, #000 48px)}.tab-config__scroll--middle.sc-snk-tab-config{-webkit-mask-image:linear-gradient(90deg, transparent 20px, #000 48px, #000 calc(100% - 48px), transparent calc(100% - 20px))}.tab-config__scroll--end-hidden.sc-snk-tab-config{-webkit-mask-image:linear-gradient(90deg, #000 calc(100% - 48px), transparent calc(100% - 20px))}.tab-config__lower-bar.sc-snk-tab-config{position:absolute;left:0%;right:0%;top:91%;bottom:0%;border-radius:2px;background:var(--color--disable-primary);border:2px solid var(--color--disable-primary)}.tab-config__tab.sc-snk-tab-config{display:flex;border:none;background-color:unset;cursor:pointer;align-items:center;justify-content:center;min-width:fit-content;color:var(--text--primary, #626e82);font-family:var(--font-pattern, \"Roboto\");font-size:var(--title--small, 14px);padding:var(--space--small, 6px) var(--space--medium, 12px)}.tab-config__tab.sc-snk-tab-config:focus,.tab-config__forward-button.sc-snk-tab-config,.tab-config__backward-button.sc-snk-tab-config{outline:none}.tab-config__tab--is-active.sc-snk-tab-config{position:relative;color:var(--color--primary, #008561)}.tab-config__tab.sc-snk-tab-config:hover{color:var(--color--secondary, #383c45)}.tab-config__tab--is-active.sc-snk-tab-config:hover{color:var(--color--primary, #008561)}.tab-config__tab--is-active.sc-snk-tab-config::after{content:\"\";position:absolute;width:100%;height:100%;background-color:var(--color--primary, #008561);clip-path:inset(calc(100% - 3px) 0px 0px 0px);animation:activate 0.25s ease-in-out}.tab-config__tab--is-focused.sc-snk-tab-config{border:1px dashed var(--color--primary, #000000c5)}.tab-config__tab-label.sc-snk-tab-config{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-shadow:var(--text-shadow);margin-bottom:var(--space--extra-small, 3px)}.tab-config__forward-button.sc-snk-tab-config,.tab-config__backward-button.sc-snk-tab-config{position:absolute;z-index:1;display:flex;box-sizing:border-box;padding:0px;top:0px;right:0px;width:16px;height:100%;border:none;background-color:unset;cursor:pointer;justify-content:center;align-items:center}.tab-config__new-button.sc-snk-tab-config{position:absolute;z-index:1;display:flex;box-sizing:border-box;padding:0px;top:0px;right:0px;height:100%;border:none;background-color:unset;cursor:pointer;justify-content:center;align-items:center}.tab-config__new-button.sc-snk-tab-config ez-icon.sc-snk-tab-config{--ez-icon--color:var(--color--secondary-700, #1C1D22)}.tab-config__backward-button.sc-snk-tab-config{left:0px;box-shadow:10px 10px 5px 5px white;background:white}.tab-config__forward-button.sc-snk-tab-config{box-shadow:10px 10px 5px 20px white;background:white}.tab-config__forward-button.sc-snk-tab-config::after,.tab-config__backward-button.sc-snk-tab-config::after{content:'';display:flex;background-color:var(--text--primary, #008561);width:10px;height:16px}.tab-config__forward-button.sc-snk-tab-config::after{-webkit-mask-image:var(--snk-tab-config--forward-icon);mask-image:var(--snk-tab-config--forward-icon)}.tab-config__backward-button.sc-snk-tab-config::after{-webkit-mask-image:var(--snk-tab-config--backward-icon);mask-image:var(--snk-tab-config--backward-icon)}.tab-config__forward-button.sc-snk-tab-config:hover::after,.tab-config__backward-button.sc-snk-tab-config:hover::after{background-color:var(--color--primary, #4e4e4e)}.tab-config__new-button.sc-snk-tab-config:hover ez-icon.sc-snk-tab-config{--ez-icon--color:var(--color--primary, #4e4e4e)}.tab-config__hidden.sc-snk-tab-config{display:none}.tab-config__scroll.sc-snk-tab-config::-webkit-scrollbar{display:none}.tab-config__left-icon.sc-snk-tab-config{padding-right:var(--space--small);--ez-icon--color:var(--text--disable)}.tab-config__left-icon--eye-off.sc-snk-tab-config{--ez-icon--color:var(--text--disable, #AFB6C0)}.tab-config__right-icon.sc-snk-tab-config{visibility:hidden;padding-left:var(--space--small)}.tab-config__tab.sc-snk-tab-config:hover .tab-config__right-icon.sc-snk-tab-config{visibility:visible}.tab-config__tab--is-active.sc-snk-tab-config .tab-config__right-icon.sc-snk-tab-config{visibility:visible;--ez-icon--color:var(--color--primary)}.tab-config__tab.sc-snk-tab-config:hover .tab-config__right-icon.sc-snk-tab-config{--ez-icon--color:var(--color--secondary, #383c45)}.tab-config__tab--is-active.sc-snk-tab-config:hover .tab-config__right-icon.sc-snk-tab-config{--ez-icon--color:var(--color--primary)}.tab-config__actions-button.sc-snk-tab-config{--ez-actions-button__btn-action--min-width:100px;visibility:hidden;opacity:0;transition:visibility 1s linear,opacity 0.3s linear}.tab-config__tab.sc-snk-tab-config:hover .tab-config__actions-button.sc-snk-tab-config{visibility:visible;opacity:1;transition:visibility 0.2s linear, opacity 0.10s linear}[data-draggable-element].sc-snk-tab-config{cursor:grab}.tab-config__tab-label-disabled.sc-snk-tab-config{color:var(--text--disable, #AFB6C0)}.tab-config__slot.sc-snk-tab-config{margin-left:var(--space--small, 6px)}";
|
|
6888
6888
|
|
|
6889
6889
|
const SnkTabConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement$1 {
|
|
6890
6890
|
constructor() {
|
|
@@ -56,5 +56,19 @@ const TYPE_ACTIONS = {
|
|
|
56
56
|
const TAB_NAMES = {
|
|
57
57
|
main: "__main"
|
|
58
58
|
};
|
|
59
|
+
const TAGS_BY_TYPE = {
|
|
60
|
+
LONGTEXT: "ez-text-area",
|
|
61
|
+
FILE: "ez-upload",
|
|
62
|
+
DATE: "ez-date-input",
|
|
63
|
+
TIME: "ez-time",
|
|
64
|
+
DATETIME: "ez-date-time-input",
|
|
65
|
+
DEFAULT: "ez-text-input",
|
|
66
|
+
SWITCH: "ez-check",
|
|
67
|
+
CHECKBOX: "ez-check",
|
|
68
|
+
OPTIONSELECTOR: "ez-combo-box",
|
|
69
|
+
SEARCH: "ez-search",
|
|
70
|
+
INTEGERNUMBER: "ez-number-input",
|
|
71
|
+
DECIMALNUMBER: "ez-number-input"
|
|
72
|
+
};
|
|
59
73
|
|
|
60
|
-
export { ACTION_CONFIG as A, CONFIG_EVENTS as C, DEFAULT_TYPE as D, KEY_EVENTS as K, TAB_NAMES as T, VARS_BY_TYPE as V,
|
|
74
|
+
export { ACTION_CONFIG as A, CONFIG_EVENTS as C, DEFAULT_TYPE as D, KEY_EVENTS as K, TAB_NAMES as T, VARS_BY_TYPE as V, TAGS_BY_TYPE as a, TYPE_ACTIONS as b, VIEW_MODE as c };
|
|
@@ -31,6 +31,7 @@ const uniqueTime = (key, measureText) => {
|
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
33
|
const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
|
34
|
+
const XLINK_NS = 'http://www.w3.org/1999/xlink';
|
|
34
35
|
/**
|
|
35
36
|
* Default style mode id
|
|
36
37
|
*/
|
|
@@ -339,6 +340,31 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
339
340
|
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
340
341
|
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
341
342
|
}
|
|
343
|
+
else if (memberName === 'style') {
|
|
344
|
+
// update style attribute, css properties and values
|
|
345
|
+
{
|
|
346
|
+
for (const prop in oldValue) {
|
|
347
|
+
if (!newValue || newValue[prop] == null) {
|
|
348
|
+
if (prop.includes('-')) {
|
|
349
|
+
elm.style.removeProperty(prop);
|
|
350
|
+
}
|
|
351
|
+
else {
|
|
352
|
+
elm.style[prop] = '';
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
for (const prop in newValue) {
|
|
358
|
+
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
|
359
|
+
if (prop.includes('-')) {
|
|
360
|
+
elm.style.setProperty(prop, newValue[prop]);
|
|
361
|
+
}
|
|
362
|
+
else {
|
|
363
|
+
elm.style[prop] = newValue[prop];
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}
|
|
342
368
|
else if (memberName === 'key')
|
|
343
369
|
;
|
|
344
370
|
else if (memberName === 'ref') {
|
|
@@ -407,16 +433,36 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
407
433
|
}
|
|
408
434
|
catch (e) { }
|
|
409
435
|
}
|
|
436
|
+
/**
|
|
437
|
+
* Need to manually update attribute if:
|
|
438
|
+
* - memberName is not an attribute
|
|
439
|
+
* - if we are rendering the host element in order to reflect attribute
|
|
440
|
+
* - if it's a SVG, since properties might not work in <svg>
|
|
441
|
+
* - if the newValue is null/undefined or 'false'.
|
|
442
|
+
*/
|
|
443
|
+
let xlink = false;
|
|
444
|
+
{
|
|
445
|
+
if (ln !== (ln = ln.replace(/^xlink\:?/, ''))) {
|
|
446
|
+
memberName = ln;
|
|
447
|
+
xlink = true;
|
|
448
|
+
}
|
|
449
|
+
}
|
|
410
450
|
if (newValue == null || newValue === false) {
|
|
411
451
|
if (newValue !== false || elm.getAttribute(memberName) === '') {
|
|
412
|
-
{
|
|
452
|
+
if (xlink) {
|
|
453
|
+
elm.removeAttributeNS(XLINK_NS, memberName);
|
|
454
|
+
}
|
|
455
|
+
else {
|
|
413
456
|
elm.removeAttribute(memberName);
|
|
414
457
|
}
|
|
415
458
|
}
|
|
416
459
|
}
|
|
417
460
|
else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
|
|
418
461
|
newValue = newValue === true ? '' : newValue;
|
|
419
|
-
{
|
|
462
|
+
if (xlink) {
|
|
463
|
+
elm.setAttributeNS(XLINK_NS, memberName, newValue);
|
|
464
|
+
}
|
|
465
|
+
else {
|
|
420
466
|
elm.setAttribute(memberName, newValue);
|
|
421
467
|
}
|
|
422
468
|
}
|