@sme.up/ketchup 5.2.0-SNAPSHOT → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{cell-utils-5b16c180.js → cell-utils-153fb565.js} +2 -2
- package/dist/cjs/{f-button-3b9f32af.js → f-button-8f07d095.js} +2 -2
- package/dist/cjs/{f-cell-c6ad973a.js → f-cell-c08ad501.js} +8 -96
- package/dist/cjs/{f-chip-bed86c4a.js → f-chip-aa8d9253.js} +3 -3
- package/dist/cjs/{f-image-08a3d340.js → f-image-42025f08.js} +2 -2
- package/dist/cjs/f-text-field-b6300c8a.js +94 -0
- package/dist/cjs/f-text-field-mdc-a67f5dfe.js +2852 -0
- package/dist/cjs/{index-8d7bb3be.js → index-eb556444.js} +2 -0
- package/dist/cjs/ketchup.cjs.js +3 -3
- package/dist/cjs/kup-accordion.cjs.entry.js +4 -4
- package/dist/cjs/kup-autocomplete_27.cjs.entry.js +455 -3068
- package/dist/cjs/kup-calendar.cjs.entry.js +7 -7
- package/dist/cjs/kup-cell.cjs.entry.js +8 -7
- package/dist/cjs/kup-dash-list.cjs.entry.js +4 -4
- package/dist/cjs/kup-dash_2.cjs.entry.js +3 -3
- package/dist/cjs/kup-drawer.cjs.entry.js +4 -4
- package/dist/cjs/kup-echart.cjs.entry.js +4 -4
- package/dist/cjs/kup-field.cjs.entry.js +2 -2
- package/dist/cjs/kup-form-editor.cjs.entry.js +404 -0
- package/dist/cjs/kup-iframe.cjs.entry.js +3 -3
- package/dist/cjs/kup-lazy.cjs.entry.js +3 -3
- package/dist/cjs/kup-magic-box.cjs.entry.js +4 -4
- package/dist/cjs/{kup-manager-4227f0a2.js → kup-manager-04dc9671.js} +8391 -332
- package/dist/cjs/kup-nav-bar.cjs.entry.js +3 -3
- package/dist/cjs/kup-numeric-picker.cjs.entry.js +423 -0
- package/dist/cjs/kup-photo-frame.cjs.entry.js +3 -3
- package/dist/cjs/kup-probe.cjs.entry.js +2 -2
- package/dist/cjs/kup-qlik.cjs.entry.js +2 -2
- package/dist/cjs/kup-snackbar.cjs.entry.js +6 -6
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{utils-b9df398c.js → utils-a201de8b.js} +1 -1
- package/dist/collection/assets/data-table.js +44 -0
- package/dist/collection/assets/form-editor.js +338 -0
- package/dist/collection/assets/index.js +12 -0
- package/dist/collection/assets/kuptooltip.js +608 -0
- package/dist/collection/collection-manifest.json +3 -1
- package/dist/collection/components/kup-card/built-in/kup-card-built-in.js +10 -0
- package/dist/collection/components/kup-card/built-in/kup-card-column-drop-menu.js +1 -2
- package/dist/collection/components/kup-card/built-in/kup-card-numeric.js +153 -0
- package/dist/collection/components/kup-card/kup-card.css +35 -0
- package/dist/collection/components/kup-card/kup-card.js +2 -2
- package/dist/collection/components/kup-data-table/kup-data-table-state.js +1 -1
- package/dist/collection/components/kup-data-table/kup-data-table.js +44 -12
- package/dist/collection/components/kup-date-picker/kup-date-picker.js +1 -1
- package/dist/collection/components/kup-drawer/kup-drawer.css +1 -0
- package/dist/collection/components/kup-form-editor/kup-form-editor-declarations.js +23 -0
- package/dist/collection/components/kup-form-editor/kup-form-editor.css +80 -0
- package/dist/collection/components/kup-form-editor/kup-form-editor.js +561 -0
- package/dist/collection/components/kup-numeric-picker/kup-numeric-picker-declarations.js +16 -0
- package/dist/collection/components/kup-numeric-picker/kup-numeric-picker.css +50 -0
- package/dist/collection/components/kup-numeric-picker/kup-numeric-picker.js +895 -0
- package/dist/collection/components/kup-snackbar/kup-snackbar.css +4 -0
- package/dist/collection/components/kup-tree/kup-tree.css +10 -3
- package/dist/collection/components/kup-tree/kup-tree.js +75 -13
- package/dist/collection/managers/kup-debug/kup-debug.js +1 -0
- package/dist/collection/managers/kup-manager/kup-manager.js +28 -1
- package/dist/collection/managers/kup-math/kup-math.js +11 -1
- package/dist/collection/managers/kup-theme/kup-theme-declarations.js +3 -0
- package/dist/collection/managers/kup-tooltip/kup-tooltip-declarations.js +1 -0
- package/dist/collection/managers/kup-tooltip/kup-tooltip.js +191 -0
- package/dist/collection/types/GenericTypes.js +2 -0
- package/dist/collection/utils/kup-column-menu/kup-column-menu.js +1 -1
- package/dist/esm/{cell-utils-69f75e2e.js → cell-utils-55b4278f.js} +2 -2
- package/dist/esm/{f-button-7e7607d8.js → f-button-ea5059eb.js} +2 -2
- package/dist/esm/{f-cell-e4d83c27.js → f-cell-d767085a.js} +8 -95
- package/dist/esm/{f-chip-51dfefaf.js → f-chip-e99f71a0.js} +3 -3
- package/dist/esm/{f-image-de331954.js → f-image-7bea0647.js} +2 -2
- package/dist/esm/f-text-field-662a1d4b.js +92 -0
- package/dist/esm/f-text-field-mdc-9fbbefc3.js +2850 -0
- package/dist/esm/{index-aeec9835.js → index-baeab1ac.js} +2 -1
- package/dist/esm/ketchup.js +3 -3
- package/dist/esm/kup-accordion.entry.js +4 -4
- package/dist/esm/kup-autocomplete_27.entry.js +439 -3052
- package/dist/esm/kup-calendar.entry.js +7 -7
- package/dist/esm/kup-cell.entry.js +8 -7
- package/dist/esm/kup-dash-list.entry.js +4 -4
- package/dist/esm/kup-dash_2.entry.js +3 -3
- package/dist/esm/kup-drawer.entry.js +4 -4
- package/dist/esm/kup-echart.entry.js +4 -4
- package/dist/esm/kup-field.entry.js +2 -2
- package/dist/esm/kup-form-editor.entry.js +400 -0
- package/dist/esm/kup-iframe.entry.js +3 -3
- package/dist/esm/kup-lazy.entry.js +3 -3
- package/dist/esm/kup-magic-box.entry.js +4 -4
- package/dist/esm/{kup-manager-0ab94726.js → kup-manager-25d71df2.js} +8391 -332
- package/dist/esm/kup-nav-bar.entry.js +3 -3
- package/dist/esm/kup-numeric-picker.entry.js +419 -0
- package/dist/esm/kup-photo-frame.entry.js +3 -3
- package/dist/esm/kup-probe.entry.js +2 -2
- package/dist/esm/kup-qlik.entry.js +2 -2
- package/dist/esm/kup-snackbar.entry.js +6 -6
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{utils-35c7a90d.js → utils-e4ea8310.js} +1 -1
- package/dist/ketchup/ketchup.esm.js +1 -1
- package/dist/ketchup/{p-67c64257.entry.js → p-04a941d9.entry.js} +1 -1
- package/dist/ketchup/{p-fea316ab.entry.js → p-12e5c8b7.entry.js} +1 -1
- package/dist/ketchup/{p-b5e1dbfa.entry.js → p-1e727a6c.entry.js} +1 -1
- package/dist/ketchup/{p-24df4f29.entry.js → p-2d322313.entry.js} +1 -1
- package/dist/ketchup/{p-8be1337b.js → p-34b74425.js} +1 -1
- package/dist/ketchup/p-38dbf4b3.entry.js +1 -0
- package/dist/ketchup/{p-5d190cf5.js → p-3b867a04.js} +1 -1
- package/dist/ketchup/{p-3813281b.entry.js → p-3e4a0ce7.entry.js} +1 -1
- package/dist/ketchup/{p-f9c41e20.entry.js → p-423f8dd0.entry.js} +1 -1
- package/dist/ketchup/p-44ffd4c9.js +30 -0
- package/dist/ketchup/{p-33073f4a.js → p-52aaf54a.js} +1 -1
- package/dist/ketchup/p-5969f1e8.entry.js +9 -0
- package/dist/ketchup/p-65c045fa.entry.js +1 -0
- package/dist/ketchup/{p-8f735633.entry.js → p-700b2d70.entry.js} +1 -1
- package/dist/ketchup/{p-68fc1428.entry.js → p-72ce09e3.entry.js} +1 -1
- package/dist/ketchup/p-76cffe8d.js +1 -0
- package/dist/ketchup/{p-96101f09.entry.js → p-787615f8.entry.js} +1 -1
- package/dist/ketchup/p-8bd00b7f.entry.js +1 -0
- package/dist/ketchup/p-937cd436.js +1 -0
- package/dist/ketchup/{p-3445be1e.entry.js → p-95754af8.entry.js} +1 -1
- package/dist/ketchup/{p-d7af8156.entry.js → p-9a3c41c2.entry.js} +1 -1
- package/dist/ketchup/p-a341d44c.entry.js +1 -0
- package/dist/ketchup/{p-9bcda66f.entry.js → p-af8dad7a.entry.js} +1 -1
- package/dist/ketchup/{p-0751aaf6.entry.js → p-dacd04a5.entry.js} +1 -1
- package/dist/ketchup/{p-10c8d755.js → p-dae6ef38.js} +1 -1
- package/dist/ketchup/{p-c314b1e6.js → p-e20d4661.js} +1 -1
- package/dist/ketchup/p-ecb7069b.js +135 -0
- package/dist/ketchup/{p-4081f5f7.entry.js → p-f4fbf6df.entry.js} +1 -1
- package/dist/ketchup/p-ffa8ad2d.js +1 -0
- package/dist/types/components/kup-card/built-in/kup-card-built-in.d.ts +7 -0
- package/dist/types/components/kup-card/built-in/kup-card-numeric.d.ts +2 -0
- package/dist/types/components/kup-card/kup-card-declarations.d.ts +26 -1
- package/dist/types/components/kup-data-table/kup-data-table-declarations.d.ts +2 -0
- package/dist/types/components/kup-data-table/kup-data-table-state.d.ts +1 -1
- package/dist/types/components/kup-data-table/kup-data-table.d.ts +4 -0
- package/dist/types/components/kup-form-editor/kup-form-editor-declarations.d.ts +79 -0
- package/dist/types/components/kup-form-editor/kup-form-editor.d.ts +72 -0
- package/dist/types/components/kup-numeric-picker/kup-numeric-picker-declarations.d.ts +19 -0
- package/dist/types/components/kup-numeric-picker/kup-numeric-picker.d.ts +121 -0
- package/dist/types/components/kup-tree/kup-tree-declarations.d.ts +1 -1
- package/dist/types/components/kup-tree/kup-tree.d.ts +1 -1
- package/dist/types/components.d.ts +196 -1
- package/dist/types/managers/kup-manager/kup-manager-declarations.d.ts +12 -0
- package/dist/types/managers/kup-manager/kup-manager.d.ts +14 -0
- package/dist/types/managers/kup-math/kup-math-declarations.d.ts +6 -0
- package/dist/types/managers/kup-math/kup-math.d.ts +2 -1
- package/dist/types/managers/kup-tooltip/kup-tooltip-declarations.d.ts +8 -0
- package/dist/types/managers/kup-tooltip/kup-tooltip.d.ts +40 -0
- package/dist/types/types/GenericTypes.d.ts +2 -0
- package/package.json +4 -3
- package/CHANGELOG.md +0 -5
- package/dist/ketchup/p-2d4f19f4.js +0 -1
- package/dist/ketchup/p-3aab1f0d.entry.js +0 -1
- package/dist/ketchup/p-47b57d97.js +0 -1
- package/dist/ketchup/p-5186885c.entry.js +0 -1
- package/dist/ketchup/p-78223dc0.entry.js +0 -143
- package/dist/ketchup/p-ee33cbe9.js +0 -9
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const utils = require('./utils-
|
|
4
|
-
const kupManager = require('./kup-manager-
|
|
3
|
+
const utils = require('./utils-a201de8b.js');
|
|
4
|
+
const kupManager = require('./kup-manager-04dc9671.js');
|
|
5
5
|
|
|
6
6
|
const dom = document.documentElement;
|
|
7
7
|
// -------------
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const index = require('./index-
|
|
3
|
+
const index = require('./index-eb556444.js');
|
|
4
4
|
const fButtonDeclarations = require('./f-button-declarations-b611587f.js');
|
|
5
|
-
const fImage = require('./f-image-
|
|
5
|
+
const fImage = require('./f-image-42025f08.js');
|
|
6
6
|
|
|
7
7
|
/*-------------------------------------------------*/
|
|
8
8
|
/* C o m p o n e n t */
|
|
@@ -1,99 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const kupManager = require('./kup-manager-
|
|
4
|
-
const index = require('./index-
|
|
5
|
-
const cellUtils = require('./cell-utils-
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
/*-------------------------------------------------*/
|
|
11
|
-
/* C o m p o n e n t */
|
|
12
|
-
/*-------------------------------------------------*/
|
|
13
|
-
const FTextField = (props, children) => {
|
|
14
|
-
return (index.h("div", Object.assign({ class: `f-text-field ${props.danger ? 'kup-danger' : ''} ${props.fullHeight ? 'kup-full-height' : ''} ${props.fullWidth ? 'kup-full-width' : ''} ${props.info ? 'kup-info' : ''} ${props.secondary ? 'kup-secondary' : ''} ${props.shaped ? 'kup-shaped' : ''} ${props.success ? 'kup-success' : ''} ${props.warning ? 'kup-warning' : ''} ${props.wrapperClass ? props.wrapperClass : ''}` }, props.dataSet, { id: props.id, title: props.title }),
|
|
15
|
-
props.leadingLabel || props.trailingLabel ? (index.h("div", { class: `mdc-form-field ${props.leadingLabel ? 'mdc-form-field--align-end' : ''}` }, [
|
|
16
|
-
setContent(props),
|
|
17
|
-
setHelper(props),
|
|
18
|
-
index.h("label", null, props.label),
|
|
19
|
-
])) : ([setContent(props), setHelper(props)]),
|
|
20
|
-
children));
|
|
21
|
-
};
|
|
22
|
-
/*-------------------------------------------------*/
|
|
23
|
-
/* M e t h o d s */
|
|
24
|
-
/*-------------------------------------------------*/
|
|
25
|
-
function setContent(props) {
|
|
26
|
-
const isOutlined = props.textArea || props.outlined;
|
|
27
|
-
let labelEl;
|
|
28
|
-
let iconEl;
|
|
29
|
-
if (props.label && !props.leadingLabel && !props.trailingLabel) {
|
|
30
|
-
labelEl = (index.h("label", { class: "mdc-floating-label", htmlFor: "kup-input" }, props.label));
|
|
31
|
-
}
|
|
32
|
-
if (props.icon) {
|
|
33
|
-
let iconStyle;
|
|
34
|
-
let iconClass = '';
|
|
35
|
-
if (Object.values(kupManager.KupThemeIconValues).indexOf(props.icon) > -1) {
|
|
36
|
-
iconClass = props.icon.replace('--', '');
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
let svg = `url('${index.getAssetPath(`./assets/svg/${props.icon}.svg`)}') no-repeat center`;
|
|
40
|
-
iconStyle = {
|
|
41
|
-
mask: svg,
|
|
42
|
-
webkitMask: svg,
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
iconEl = (index.h("span", { style: iconStyle, onClick: props.onIconClick, class: `mdc-text-field__icon kup-icon action ${iconClass}` }));
|
|
46
|
-
}
|
|
47
|
-
const classObj = {
|
|
48
|
-
'is-clearable': props.isClearable,
|
|
49
|
-
'mdc-text-field': true,
|
|
50
|
-
'mdc-text-field--disabled': props.disabled,
|
|
51
|
-
'mdc-text-field--filled': !props.fullWidth && !isOutlined,
|
|
52
|
-
'mdc-text-field--no-label': !props.label,
|
|
53
|
-
'mdc-text-field--fullwidth': props.fullWidth,
|
|
54
|
-
'mdc-text-field--outlined': isOutlined,
|
|
55
|
-
'mdc-text-field--textarea': props.textArea,
|
|
56
|
-
'mdc-text-field--with-leading-icon': props.icon && !props.trailingIcon,
|
|
57
|
-
'mdc-text-field--with-trailing-icon': props.icon && props.trailingIcon,
|
|
58
|
-
};
|
|
59
|
-
return (index.h("div", { class: classObj },
|
|
60
|
-
props.textArea && props.maxLength ? (index.h("div", { class: "mdc-text-field-character-counter" },
|
|
61
|
-
"'0 / ' + ",
|
|
62
|
-
props.maxLength)) : undefined,
|
|
63
|
-
!props.trailingIcon ? iconEl : undefined,
|
|
64
|
-
props.textArea ? (index.h("span", { class: "mdc-text-field__resizer" },
|
|
65
|
-
index.h("textarea", { class: "mdc-text-field__input", disabled: props.disabled, readOnly: props.readOnly, maxlength: props.maxLength, value: props.value, onBlur: props.onBlur, onClick: props.onClick, onChange: props.onChange, onFocus: props.onFocus, onInput: props.onInput, onKeyDown: props.onKeyDown }))) : (index.h("input", { type: props.inputType ? props.inputType : 'text', step: props.step, min: props.min, max: props.max, class: "mdc-text-field__input", disabled: props.disabled, readOnly: props.readOnly, placeholder: props.fullWidth ? props.label : undefined, maxlength: props.maxLength, value: props.value, onBlur: props.onBlur, onClick: props.onClick, onChange: props.onChange, onFocus: props.onFocus, onInput: props.onInput, onKeyDown: props.onKeyDown })),
|
|
66
|
-
props.isClearable ? (index.h("span", { class: `mdc-text-field__icon kup-icon ${kupManager.KupThemeIconValues.CLEAR.replace('--', '')}`, onClick: props.onClearIconClick })) : undefined,
|
|
67
|
-
props.trailingIcon ? iconEl : undefined,
|
|
68
|
-
!props.fullWidth && !isOutlined ? labelEl : undefined,
|
|
69
|
-
isOutlined ? (index.h("div", { class: "mdc-notched-outline" },
|
|
70
|
-
index.h("div", { class: "mdc-notched-outline__leading" }),
|
|
71
|
-
index.h("div", { class: "mdc-notched-outline__notch" }, labelEl),
|
|
72
|
-
index.h("div", { class: "mdc-notched-outline__trailing" }))) : (index.h("span", { class: "mdc-line-ripple" }))));
|
|
73
|
-
}
|
|
74
|
-
function setHelper(props) {
|
|
75
|
-
if (props.helperEnabled !== false) {
|
|
76
|
-
if (props.helper) {
|
|
77
|
-
const classObj = {
|
|
78
|
-
'mdc-text-field-helper-text': true,
|
|
79
|
-
'mdc-text-field-helper-text--persistent': !props.helperWhenFocused,
|
|
80
|
-
};
|
|
81
|
-
return (index.h("div", { class: "mdc-text-field-helper-line" },
|
|
82
|
-
index.h("div", { class: classObj }, props.helper),
|
|
83
|
-
props.maxLength && !props.textArea ? (index.h("div", { class: "mdc-text-field-character-counter" },
|
|
84
|
-
"'0 / ' + ",
|
|
85
|
-
props.maxLength.toString())) : undefined));
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
88
|
-
if (props.maxLength && !props.textArea) {
|
|
89
|
-
return (index.h("div", { class: "mdc-text-field-helper-line" },
|
|
90
|
-
index.h("div", { class: "mdc-text-field-character-counter" },
|
|
91
|
-
"'0 / ' + ",
|
|
92
|
-
props.maxLength)));
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
3
|
+
const kupManager = require('./kup-manager-04dc9671.js');
|
|
4
|
+
const index = require('./index-eb556444.js');
|
|
5
|
+
const cellUtils = require('./cell-utils-153fb565.js');
|
|
6
|
+
const fTextField = require('./f-text-field-b6300c8a.js');
|
|
7
|
+
const utils = require('./utils-a201de8b.js');
|
|
8
|
+
const fImage = require('./f-image-42025f08.js');
|
|
9
|
+
const fChip = require('./f-chip-aa8d9253.js');
|
|
97
10
|
|
|
98
11
|
const autoAlignComps = [kupManager.KupTagNames.DATA_TABLE, kupManager.KupTagNames.TREE];
|
|
99
12
|
/**
|
|
@@ -477,7 +390,7 @@ function setEditableCell(cellType, classObj, cell, column, props) {
|
|
|
477
390
|
case FCellTypes.NUMBER:
|
|
478
391
|
classObj[FCellClasses.C_RIGHT_ALIGNED] = true;
|
|
479
392
|
case FCellTypes.STRING:
|
|
480
|
-
return (index.h(FTextField, Object.assign({}, cell.data, { icon: cell.icon ? cell.icon : column.icon ? column.icon : null, fullWidth: true, inputType: cellType === FCellTypes.NUMBER ? 'number' : null, value: cellType === FCellTypes.NUMBER
|
|
393
|
+
return (index.h(fTextField.FTextField, Object.assign({}, cell.data, { icon: cell.icon ? cell.icon : column.icon ? column.icon : null, fullWidth: true, inputType: cellType === FCellTypes.NUMBER ? 'number' : null, value: cellType === FCellTypes.NUMBER
|
|
481
394
|
? utils.stringToNumber(cell.value).toString()
|
|
482
395
|
: cell.value, onChange: (e) => cellEvent(e, props, cellType, FCellEvents.UPDATE), onInput: (e) => cellEvent(e, props, cellType, FCellEvents.INPUT), onIconClick: (e) => cellEvent(e, props, cellType, FCellEvents.ICON_CLICK) })));
|
|
483
396
|
}
|
|
@@ -738,4 +651,3 @@ function cellEvent(e, props, cellType, cellEventName) {
|
|
|
738
651
|
|
|
739
652
|
exports.FCell = FCell;
|
|
740
653
|
exports.FCheckbox = FCheckbox;
|
|
741
|
-
exports.FTextField = FTextField;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const index = require('./index-
|
|
4
|
-
const fImage = require('./f-image-
|
|
5
|
-
const kupManager = require('./kup-manager-
|
|
3
|
+
const index = require('./index-eb556444.js');
|
|
4
|
+
const fImage = require('./f-image-42025f08.js');
|
|
5
|
+
const kupManager = require('./kup-manager-04dc9671.js');
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Types of the f-chip component.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const index = require('./index-
|
|
4
|
-
const kupManager = require('./kup-manager-
|
|
3
|
+
const index = require('./index-eb556444.js');
|
|
4
|
+
const kupManager = require('./kup-manager-04dc9671.js');
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* The type of a CSS step in CSS-drawing mode.
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const index = require('./index-eb556444.js');
|
|
4
|
+
const kupManager = require('./kup-manager-04dc9671.js');
|
|
5
|
+
|
|
6
|
+
/*-------------------------------------------------*/
|
|
7
|
+
/* C o m p o n e n t */
|
|
8
|
+
/*-------------------------------------------------*/
|
|
9
|
+
const FTextField = (props, children) => {
|
|
10
|
+
return (index.h("div", Object.assign({ class: `f-text-field ${props.danger ? 'kup-danger' : ''} ${props.fullHeight ? 'kup-full-height' : ''} ${props.fullWidth ? 'kup-full-width' : ''} ${props.info ? 'kup-info' : ''} ${props.secondary ? 'kup-secondary' : ''} ${props.shaped ? 'kup-shaped' : ''} ${props.success ? 'kup-success' : ''} ${props.warning ? 'kup-warning' : ''} ${props.wrapperClass ? props.wrapperClass : ''}` }, props.dataSet, { id: props.id, title: props.title }),
|
|
11
|
+
props.leadingLabel || props.trailingLabel ? (index.h("div", { class: `mdc-form-field ${props.leadingLabel ? 'mdc-form-field--align-end' : ''}` }, [
|
|
12
|
+
setContent(props),
|
|
13
|
+
setHelper(props),
|
|
14
|
+
index.h("label", null, props.label),
|
|
15
|
+
])) : ([setContent(props), setHelper(props)]),
|
|
16
|
+
children));
|
|
17
|
+
};
|
|
18
|
+
/*-------------------------------------------------*/
|
|
19
|
+
/* M e t h o d s */
|
|
20
|
+
/*-------------------------------------------------*/
|
|
21
|
+
function setContent(props) {
|
|
22
|
+
const isOutlined = props.textArea || props.outlined;
|
|
23
|
+
let labelEl;
|
|
24
|
+
let iconEl;
|
|
25
|
+
if (props.label && !props.leadingLabel && !props.trailingLabel) {
|
|
26
|
+
labelEl = (index.h("label", { class: "mdc-floating-label", htmlFor: "kup-input" }, props.label));
|
|
27
|
+
}
|
|
28
|
+
if (props.icon) {
|
|
29
|
+
let iconStyle;
|
|
30
|
+
let iconClass = '';
|
|
31
|
+
if (Object.values(kupManager.KupThemeIconValues).indexOf(props.icon) > -1) {
|
|
32
|
+
iconClass = props.icon.replace('--', '');
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
let svg = `url('${index.getAssetPath(`./assets/svg/${props.icon}.svg`)}') no-repeat center`;
|
|
36
|
+
iconStyle = {
|
|
37
|
+
mask: svg,
|
|
38
|
+
webkitMask: svg,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
iconEl = (index.h("span", { style: iconStyle, onClick: props.onIconClick, class: `mdc-text-field__icon kup-icon action ${iconClass}` }));
|
|
42
|
+
}
|
|
43
|
+
const classObj = {
|
|
44
|
+
'is-clearable': props.isClearable,
|
|
45
|
+
'mdc-text-field': true,
|
|
46
|
+
'mdc-text-field--disabled': props.disabled,
|
|
47
|
+
'mdc-text-field--filled': !props.fullWidth && !isOutlined,
|
|
48
|
+
'mdc-text-field--no-label': !props.label,
|
|
49
|
+
'mdc-text-field--fullwidth': props.fullWidth,
|
|
50
|
+
'mdc-text-field--outlined': isOutlined,
|
|
51
|
+
'mdc-text-field--textarea': props.textArea,
|
|
52
|
+
'mdc-text-field--with-leading-icon': props.icon && !props.trailingIcon,
|
|
53
|
+
'mdc-text-field--with-trailing-icon': props.icon && props.trailingIcon,
|
|
54
|
+
};
|
|
55
|
+
return (index.h("div", { class: classObj },
|
|
56
|
+
props.textArea && props.maxLength ? (index.h("div", { class: "mdc-text-field-character-counter" },
|
|
57
|
+
"'0 / ' + ",
|
|
58
|
+
props.maxLength)) : undefined,
|
|
59
|
+
!props.trailingIcon ? iconEl : undefined,
|
|
60
|
+
props.textArea ? (index.h("span", { class: "mdc-text-field__resizer" },
|
|
61
|
+
index.h("textarea", { class: "mdc-text-field__input", disabled: props.disabled, readOnly: props.readOnly, maxlength: props.maxLength, value: props.value, onBlur: props.onBlur, onClick: props.onClick, onChange: props.onChange, onFocus: props.onFocus, onInput: props.onInput, onKeyDown: props.onKeyDown }))) : (index.h("input", { type: props.inputType ? props.inputType : 'text', step: props.step, min: props.min, max: props.max, class: "mdc-text-field__input", disabled: props.disabled, readOnly: props.readOnly, placeholder: props.fullWidth ? props.label : undefined, maxlength: props.maxLength, value: props.value, onBlur: props.onBlur, onClick: props.onClick, onChange: props.onChange, onFocus: props.onFocus, onInput: props.onInput, onKeyDown: props.onKeyDown })),
|
|
62
|
+
props.isClearable ? (index.h("span", { class: `mdc-text-field__icon kup-icon ${kupManager.KupThemeIconValues.CLEAR.replace('--', '')}`, onClick: props.onClearIconClick })) : undefined,
|
|
63
|
+
props.trailingIcon ? iconEl : undefined,
|
|
64
|
+
!props.fullWidth && !isOutlined ? labelEl : undefined,
|
|
65
|
+
isOutlined ? (index.h("div", { class: "mdc-notched-outline" },
|
|
66
|
+
index.h("div", { class: "mdc-notched-outline__leading" }),
|
|
67
|
+
index.h("div", { class: "mdc-notched-outline__notch" }, labelEl),
|
|
68
|
+
index.h("div", { class: "mdc-notched-outline__trailing" }))) : (index.h("span", { class: "mdc-line-ripple" }))));
|
|
69
|
+
}
|
|
70
|
+
function setHelper(props) {
|
|
71
|
+
if (props.helperEnabled !== false) {
|
|
72
|
+
if (props.helper) {
|
|
73
|
+
const classObj = {
|
|
74
|
+
'mdc-text-field-helper-text': true,
|
|
75
|
+
'mdc-text-field-helper-text--persistent': !props.helperWhenFocused,
|
|
76
|
+
};
|
|
77
|
+
return (index.h("div", { class: "mdc-text-field-helper-line" },
|
|
78
|
+
index.h("div", { class: classObj }, props.helper),
|
|
79
|
+
props.maxLength && !props.textArea ? (index.h("div", { class: "mdc-text-field-character-counter" },
|
|
80
|
+
"'0 / ' + ",
|
|
81
|
+
props.maxLength.toString())) : undefined));
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
if (props.maxLength && !props.textArea) {
|
|
85
|
+
return (index.h("div", { class: "mdc-text-field-helper-line" },
|
|
86
|
+
index.h("div", { class: "mdc-text-field-character-counter" },
|
|
87
|
+
"'0 / ' + ",
|
|
88
|
+
props.maxLength)));
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
exports.FTextField = FTextField;
|