bromcom-ui 2.3.61 → 2.3.62
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/bromcom-ui/bcm-date-picker.entry.js +2 -1
- package/dist/bromcom-ui/bcm-datetime-picker.entry.js +4 -1
- package/dist/bromcom-ui/bcm-form-group.entry.js +1 -1
- package/dist/bromcom-ui/bcm-form.entry.js +3 -1
- package/dist/bromcom-ui/bcm-input.entry.js +1 -0
- package/dist/bromcom-ui/bcm-listbox.entry.js +1 -0
- package/dist/bromcom-ui/bcm-select.entry.js +4 -2
- package/dist/types/components/organism/datetime-picker/datetime-picker.d.ts +1 -0
- package/dist/types/components/organism/form/form.d.ts +1 -1
- package/dist/types/components.d.ts +1 -1
- package/package.json +1 -1
- package/dist/bromcom-ui/bcm-ad02f9c9.js +0 -453
- package/dist/bromcom-ui/bcm-list-2-item.entry.js +0 -36
- package/dist/bromcom-ui/bcm-list-2.entry.js +0 -834
- package/dist/bromcom-ui/bcm-range.entry.js +0 -160
- package/dist/bromcom-ui/bcm-search-2.entry.js +0 -190
- package/dist/bromcom-ui/caption-template-2d4ffc88.js +0 -25
- package/dist/bromcom-ui/color-helper-19448077.js +0 -35
- package/dist/bromcom-ui/element-dragger-2a215f47.js +0 -273
- package/dist/bromcom-ui/generate-0a22e8df.js +0 -88
- package/dist/bromcom-ui/generate-2170e960.js +0 -81
- package/dist/bromcom-ui/generate-516a5391.js +0 -90
- package/dist/bromcom-ui/index-dbc63c66.js +0 -2818
- package/dist/bromcom-ui/index-dd5c1283.js +0 -187
- package/dist/bromcom-ui/input-template-e0e652a9.js +0 -82
- package/dist/bromcom-ui/json-parse-decarator-223ea680.js +0 -21
- package/dist/bromcom-ui/label-template-b0b70fde.js +0 -19
- package/dist/bromcom-ui/number-helper-fea1966f.js +0 -13
- package/dist/bromcom-ui/popover-placement-31e0e70f.js +0 -96
- package/dist/bromcom-ui/property-decorators-21b15487.js +0 -36
- package/dist/bromcom-ui/slot-template-5b8e1902.js +0 -9
- package/dist/bromcom-ui/snq.es5-946822b8.js +0 -14
- package/dist/bromcom-ui/string-helper-414d635d.js +0 -25
- package/dist/bromcom-ui/types-6b2a6629.js +0 -172
- package/dist/bromcom-ui/utils-333ded7f.js +0 -438
- package/dist/types/components/atoms/states/badge.states.d.ts +0 -7
- package/dist/types/components/atoms/states/button.states.d.ts +0 -7
- package/dist/types/components/molecules/breadcrumb/types.d.ts +0 -10
- package/dist/types/components/molecules/input/types.d.ts +0 -13
- package/dist/types/components/molecules/progress/types.d.ts +0 -24
- package/dist/types/components/molecules/range/range.d.ts +0 -36
- package/dist/types/components/molecules/search-2/search-2.d.ts +0 -25
- package/dist/types/components/molecules/states/alert.states.d.ts +0 -7
- package/dist/types/components/molecules/states/checkbox-group.states.d.ts +0 -53
- package/dist/types/components/molecules/states/message.states.d.ts +0 -7
- package/dist/types/components/molecules/states/notification.states.d.ts +0 -7
- package/dist/types/components/molecules/states/radio-group.states.d.ts +0 -47
- package/dist/types/components/molecules/states/result.states.d.ts +0 -7
- package/dist/types/components/molecules/states/search.states.d.ts +0 -9
- package/dist/types/components/molecules/textarea/types.d.ts +0 -9
- package/dist/types/components/organism/list-2/list-2-item.d.ts +0 -11
- package/dist/types/components/organism/list-2/list-2.d.ts +0 -102
- package/dist/types/components/organism/states/bcm-list2.states.d.ts +0 -17
- package/dist/types/decorators/json-parse-decarator.d.ts +0 -4
- package/dist/types/decorators/property-decorators.d.ts +0 -6
- package/dist/types/models/states/Atoms/bcm-Atoms-state.d.ts +0 -34
- package/dist/types/models/states/molecules/bcm-molecules-state.d.ts +0 -78
- package/dist/types/models/states/organisms/bcm-organisms-state.d.ts +0 -69
- package/dist/types/templates/button-template.d.ts +0 -16
- package/dist/types/templates/checkbox-group-template.d.ts +0 -10
- package/dist/types/templates/checkbox-template.d.ts +0 -13
- package/dist/types/templates/info-footer-template.d.ts +0 -10
- package/dist/types/templates/input-template.d.ts +0 -30
- package/dist/types/templates/list-item-template.d.ts +0 -10
- package/dist/types/templates/list-template.d.ts +0 -21
- package/dist/types/templates/tag-template.d.ts +0 -17
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
import { i as getRenderingRef, j as forceUpdate } from './index-dbc63c66.js';
|
|
2
|
-
|
|
3
|
-
const appendToMap = (map, propName, value) => {
|
|
4
|
-
const items = map.get(propName);
|
|
5
|
-
if (!items) {
|
|
6
|
-
map.set(propName, [value]);
|
|
7
|
-
}
|
|
8
|
-
else if (!items.includes(value)) {
|
|
9
|
-
items.push(value);
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
const debounce = (fn, ms) => {
|
|
13
|
-
let timeoutId;
|
|
14
|
-
return (...args) => {
|
|
15
|
-
if (timeoutId) {
|
|
16
|
-
clearTimeout(timeoutId);
|
|
17
|
-
}
|
|
18
|
-
timeoutId = setTimeout(() => {
|
|
19
|
-
timeoutId = 0;
|
|
20
|
-
fn(...args);
|
|
21
|
-
}, ms);
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Check if a possible element isConnected.
|
|
27
|
-
* The property might not be there, so we check for it.
|
|
28
|
-
*
|
|
29
|
-
* We want it to return true if isConnected is not a property,
|
|
30
|
-
* otherwise we would remove these elements and would not update.
|
|
31
|
-
*
|
|
32
|
-
* Better leak in Edge than to be useless.
|
|
33
|
-
*/
|
|
34
|
-
const isConnected = (maybeElement) => !('isConnected' in maybeElement) || maybeElement.isConnected;
|
|
35
|
-
const cleanupElements = debounce((map) => {
|
|
36
|
-
for (let key of map.keys()) {
|
|
37
|
-
map.set(key, map.get(key).filter(isConnected));
|
|
38
|
-
}
|
|
39
|
-
}, 2000);
|
|
40
|
-
const stencilSubscription = () => {
|
|
41
|
-
if (typeof getRenderingRef !== 'function') {
|
|
42
|
-
// If we are not in a stencil project, we do nothing.
|
|
43
|
-
// This function is not really exported by @stencil/core.
|
|
44
|
-
return {};
|
|
45
|
-
}
|
|
46
|
-
const elmsToUpdate = new Map();
|
|
47
|
-
return {
|
|
48
|
-
dispose: () => elmsToUpdate.clear(),
|
|
49
|
-
get: (propName) => {
|
|
50
|
-
const elm = getRenderingRef();
|
|
51
|
-
if (elm) {
|
|
52
|
-
appendToMap(elmsToUpdate, propName, elm);
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
set: (propName) => {
|
|
56
|
-
const elements = elmsToUpdate.get(propName);
|
|
57
|
-
if (elements) {
|
|
58
|
-
elmsToUpdate.set(propName, elements.filter(forceUpdate));
|
|
59
|
-
}
|
|
60
|
-
cleanupElements(elmsToUpdate);
|
|
61
|
-
},
|
|
62
|
-
reset: () => {
|
|
63
|
-
elmsToUpdate.forEach((elms) => elms.forEach(forceUpdate));
|
|
64
|
-
cleanupElements(elmsToUpdate);
|
|
65
|
-
},
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
const createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) => {
|
|
70
|
-
let states = new Map(Object.entries(defaultState !== null && defaultState !== void 0 ? defaultState : {}));
|
|
71
|
-
const handlers = {
|
|
72
|
-
dispose: [],
|
|
73
|
-
get: [],
|
|
74
|
-
set: [],
|
|
75
|
-
reset: [],
|
|
76
|
-
};
|
|
77
|
-
const reset = () => {
|
|
78
|
-
states = new Map(Object.entries(defaultState !== null && defaultState !== void 0 ? defaultState : {}));
|
|
79
|
-
handlers.reset.forEach((cb) => cb());
|
|
80
|
-
};
|
|
81
|
-
const dispose = () => {
|
|
82
|
-
// Call first dispose as resetting the state would
|
|
83
|
-
// cause less updates ;)
|
|
84
|
-
handlers.dispose.forEach((cb) => cb());
|
|
85
|
-
reset();
|
|
86
|
-
};
|
|
87
|
-
const get = (propName) => {
|
|
88
|
-
handlers.get.forEach((cb) => cb(propName));
|
|
89
|
-
return states.get(propName);
|
|
90
|
-
};
|
|
91
|
-
const set = (propName, value) => {
|
|
92
|
-
const oldValue = states.get(propName);
|
|
93
|
-
if (shouldUpdate(value, oldValue, propName)) {
|
|
94
|
-
states.set(propName, value);
|
|
95
|
-
handlers.set.forEach((cb) => cb(propName, value, oldValue));
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
const state = (typeof Proxy === 'undefined'
|
|
99
|
-
? {}
|
|
100
|
-
: new Proxy(defaultState, {
|
|
101
|
-
get(_, propName) {
|
|
102
|
-
return get(propName);
|
|
103
|
-
},
|
|
104
|
-
ownKeys(_) {
|
|
105
|
-
return Array.from(states.keys());
|
|
106
|
-
},
|
|
107
|
-
getOwnPropertyDescriptor() {
|
|
108
|
-
return {
|
|
109
|
-
enumerable: true,
|
|
110
|
-
configurable: true,
|
|
111
|
-
};
|
|
112
|
-
},
|
|
113
|
-
has(_, propName) {
|
|
114
|
-
return states.has(propName);
|
|
115
|
-
},
|
|
116
|
-
set(_, propName, value) {
|
|
117
|
-
set(propName, value);
|
|
118
|
-
return true;
|
|
119
|
-
},
|
|
120
|
-
}));
|
|
121
|
-
const on = (eventName, callback) => {
|
|
122
|
-
handlers[eventName].push(callback);
|
|
123
|
-
return () => {
|
|
124
|
-
removeFromArray(handlers[eventName], callback);
|
|
125
|
-
};
|
|
126
|
-
};
|
|
127
|
-
const onChange = (propName, cb) => {
|
|
128
|
-
const unSet = on('set', (key, newValue) => {
|
|
129
|
-
if (key === propName) {
|
|
130
|
-
cb(newValue);
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
const unReset = on('reset', () => cb(defaultState[propName]));
|
|
134
|
-
return () => {
|
|
135
|
-
unSet();
|
|
136
|
-
unReset();
|
|
137
|
-
};
|
|
138
|
-
};
|
|
139
|
-
const use = (...subscriptions) => {
|
|
140
|
-
const unsubs = subscriptions.reduce((unsubs, subscription) => {
|
|
141
|
-
if (subscription.set) {
|
|
142
|
-
unsubs.push(on('set', subscription.set));
|
|
143
|
-
}
|
|
144
|
-
if (subscription.get) {
|
|
145
|
-
unsubs.push(on('get', subscription.get));
|
|
146
|
-
}
|
|
147
|
-
if (subscription.reset) {
|
|
148
|
-
unsubs.push(on('reset', subscription.reset));
|
|
149
|
-
}
|
|
150
|
-
if (subscription.dispose) {
|
|
151
|
-
unsubs.push(on('dispose', subscription.dispose));
|
|
152
|
-
}
|
|
153
|
-
return unsubs;
|
|
154
|
-
}, []);
|
|
155
|
-
return () => unsubs.forEach((unsub) => unsub());
|
|
156
|
-
};
|
|
157
|
-
const forceUpdate = (key) => {
|
|
158
|
-
const oldValue = states.get(key);
|
|
159
|
-
handlers.set.forEach((cb) => cb(key, oldValue, oldValue));
|
|
160
|
-
};
|
|
161
|
-
return {
|
|
162
|
-
state,
|
|
163
|
-
get,
|
|
164
|
-
set,
|
|
165
|
-
on,
|
|
166
|
-
onChange,
|
|
167
|
-
use,
|
|
168
|
-
dispose,
|
|
169
|
-
reset,
|
|
170
|
-
forceUpdate,
|
|
171
|
-
};
|
|
172
|
-
};
|
|
173
|
-
const removeFromArray = (array, item) => {
|
|
174
|
-
const index = array.indexOf(item);
|
|
175
|
-
if (index >= 0) {
|
|
176
|
-
array[index] = array[array.length - 1];
|
|
177
|
-
array.length--;
|
|
178
|
-
}
|
|
179
|
-
};
|
|
180
|
-
|
|
181
|
-
const createStore = (defaultState, shouldUpdate) => {
|
|
182
|
-
const map = createObservableMap(defaultState, shouldUpdate);
|
|
183
|
-
map.use(stencilSubscription());
|
|
184
|
-
return map;
|
|
185
|
-
};
|
|
186
|
-
|
|
187
|
-
export { createStore as c };
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { h } from './index-dbc63c66.js';
|
|
2
|
-
import { c as classnames } from './index-43956e3c.js';
|
|
3
|
-
import { B as Bcm } from './bcm-ad02f9c9.js';
|
|
4
|
-
|
|
5
|
-
var defaultIcons;
|
|
6
|
-
(function (defaultIcons) {
|
|
7
|
-
defaultIcons["search"] = "search";
|
|
8
|
-
defaultIcons["email"] = "mail";
|
|
9
|
-
defaultIcons["tel"] = "phone";
|
|
10
|
-
defaultIcons["url"] = "link";
|
|
11
|
-
})(defaultIcons || (defaultIcons = {}));
|
|
12
|
-
var iconSizes;
|
|
13
|
-
(function (iconSizes) {
|
|
14
|
-
iconSizes[iconSizes["small"] = 14] = "small";
|
|
15
|
-
iconSizes[iconSizes["medium"] = 16] = "medium";
|
|
16
|
-
iconSizes[iconSizes["large"] = 18] = "large";
|
|
17
|
-
})(iconSizes || (iconSizes = {}));
|
|
18
|
-
|
|
19
|
-
const InputTemplate = ({ elementType,
|
|
20
|
-
//textarea
|
|
21
|
-
rows,
|
|
22
|
-
//props
|
|
23
|
-
id, internalId, type, placeholder, value, size,
|
|
24
|
-
//,
|
|
25
|
-
unit, unitPrefix, maxLength,
|
|
26
|
-
//boolean
|
|
27
|
-
disabled, clearable, focused, readonly, isPasswordVisible, passwordToggle, noDefaultIcon, inValid, captionType, resize,
|
|
28
|
-
// custom functions
|
|
29
|
-
changePasswordVisibility, handleClear, steps,
|
|
30
|
-
//event functions
|
|
31
|
-
ref, handleBlur, handleFocus, handleInput, handleChange, }) => {
|
|
32
|
-
const ElementTagType = Bcm.HtmlElementType[elementType] || Bcm.HtmlElementType.input;
|
|
33
|
-
type = (type === 'password' && isPasswordVisible) ? 'text' : type;
|
|
34
|
-
value = value || '';
|
|
35
|
-
value = !focused ? value + (value && (unit === null || unit === void 0 ? void 0 : unit.length) > 0 ? ' ' + unit : '') : value;
|
|
36
|
-
const templateHandleFocus = (e) => {
|
|
37
|
-
e.target.parentElement.classList.add('focused');
|
|
38
|
-
handleFocus(e);
|
|
39
|
-
};
|
|
40
|
-
const templateHandleBlur = (e) => {
|
|
41
|
-
e.target.parentElement.classList.remove('focused');
|
|
42
|
-
handleBlur(e);
|
|
43
|
-
};
|
|
44
|
-
var containerClass = classnames('bcm-input__container', ElementTagType === Bcm.HtmlElementType.textarea && classnames('bcm-input__textarea', 'textarea-size-' + Bcm.Size[size], 'resize-' + resize, 'textarea-' + size), ElementTagType === Bcm.HtmlElementType.input && classnames('input-size-' + Bcm.Size[size]), {
|
|
45
|
-
'focused': focused,
|
|
46
|
-
disabled,
|
|
47
|
-
readonly,
|
|
48
|
-
'invalid': inValid,
|
|
49
|
-
'unit': (unit === null || unit === void 0 ? void 0 : unit.length) > 0,
|
|
50
|
-
// 'empty': value?.length < 1,
|
|
51
|
-
'error': captionType === 'error'
|
|
52
|
-
});
|
|
53
|
-
const caretContainer = classnames('caret-container', {
|
|
54
|
-
'unit': (unit === null || unit === void 0 ? void 0 : unit.length) > 0,
|
|
55
|
-
'disabled': disabled || readonly || inValid
|
|
56
|
-
});
|
|
57
|
-
const inputClass = size === 'large' ? 'size-3' : 'size-2';
|
|
58
|
-
const unitClass = classnames(inputClass, 'unit-prefix');
|
|
59
|
-
return (h("div", { class: containerClass },
|
|
60
|
-
h("span", { hidden: true },
|
|
61
|
-
h("slot", null)),
|
|
62
|
-
h("span", { class: "input-prefix" },
|
|
63
|
-
h("slot", { name: "prefix" }),
|
|
64
|
-
unitPrefix && h("span", { class: unitClass }, unitPrefix)),
|
|
65
|
-
h(ElementTagType, Object.assign({ tabindex: "1", id: id, "bcm-internal-id": internalId, class: 'bcm-input-element ' + inputClass }, ((ElementTagType === Bcm.HtmlElementType.input && { type: type })), ((ElementTagType === Bcm.HtmlElementType.textarea && { rows: rows })), { value: value, maxLength: maxLength, placeholder: placeholder, disabled: disabled, readOnly: readonly, ref: (el) => ref(el), onBlur: (e) => templateHandleBlur(e), onFocus: (e) => templateHandleFocus(e), onInput: (e) => handleInput(e), onChange: (e) => handleChange(e) })),
|
|
66
|
-
(clearable && !disabled) &&
|
|
67
|
-
h("span", { class: "input-suffix input-suffix-button input-clear-button", onClick: (e) => handleClear(e) },
|
|
68
|
-
h("bcm-icon", { icon: "close-circle", type: "fill", size: iconSizes[size], color: "grey-7" })),
|
|
69
|
-
(type === 'password' && passwordToggle) && (h("span", { class: "input-suffix input-suffix-button", onClick: () => changePasswordVisibility() },
|
|
70
|
-
h("bcm-icon", { icon: isPasswordVisible ? "eye-invisible" : "eye", type: "outlined", size: iconSizes[size], color: "grey-7" }))),
|
|
71
|
-
(Object.keys(defaultIcons).includes(type) && !noDefaultIcon) && (h("span", { class: "input-suffix" },
|
|
72
|
-
h("bcm-icon", { icon: defaultIcons[type], type: "outlined", size: iconSizes[size], color: "grey-7" }))),
|
|
73
|
-
type === 'number' && (h("div", { class: caretContainer },
|
|
74
|
-
h("span", { class: "caret", onClick: () => steps('up') },
|
|
75
|
-
h("bcm-icon", { icon: "caret-up", type: "outlined", color: "grey-7", size: 8 })),
|
|
76
|
-
h("span", { class: "caret", onClick: () => steps('down') },
|
|
77
|
-
h("bcm-icon", { icon: "caret-down", type: "outlined", color: "grey-7", size: 8 })))),
|
|
78
|
-
type !== 'number' && (h("span", { class: "input-suffix" },
|
|
79
|
-
h("slot", { name: "suffix" })))));
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
export { InputTemplate as I };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { g as getElement } from './index-dbc63c66.js';
|
|
2
|
-
import { s as snq } from './snq.es5-946822b8.js';
|
|
3
|
-
|
|
4
|
-
function JsonParse(attribute) {
|
|
5
|
-
return (proto, propName) => {
|
|
6
|
-
const { connectedCallback } = proto;
|
|
7
|
-
proto.connectedCallback = function () {
|
|
8
|
-
const host = getElement(this);
|
|
9
|
-
if (host[propName]) {
|
|
10
|
-
const value = snq(() => host.hasAttribute(attribute) ? host.getAttribute(attribute).valueOf() : host[attribute].valueOf(), null);
|
|
11
|
-
if (value) {
|
|
12
|
-
this[propName] = snq(() => typeof value === 'string' ? JSON.parse(value) : value, []);
|
|
13
|
-
host.removeAttribute(attribute);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
return connectedCallback && connectedCallback.call(this);
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export { JsonParse as J };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { h } from './index-dbc63c66.js';
|
|
2
|
-
import { c as classnames } from './index-43956e3c.js';
|
|
3
|
-
import { B as Bcm } from './bcm-ad02f9c9.js';
|
|
4
|
-
import { S as SlotTemplate } from './slot-template-5b8e1902.js';
|
|
5
|
-
|
|
6
|
-
const LabelTemplate = ({ required, value, size, form, htmlFor, type }) => {
|
|
7
|
-
size = size || Bcm.FontSize['size-1'];
|
|
8
|
-
type = type || Bcm.Status.default;
|
|
9
|
-
const labelClasses = classnames('bcm-label__text', size, {
|
|
10
|
-
'bcm-label__text-error': type === Bcm.Status.error,
|
|
11
|
-
});
|
|
12
|
-
return (h("label", { form: form, htmlFor: htmlFor, class: labelClasses },
|
|
13
|
-
" ",
|
|
14
|
-
h(SlotTemplate, { value: value }),
|
|
15
|
-
" ",
|
|
16
|
-
required && ('*')));
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export { LabelTemplate as L };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { s as snq } from './snq.es5-946822b8.js';
|
|
2
|
-
|
|
3
|
-
class NumberHelper {
|
|
4
|
-
}
|
|
5
|
-
NumberHelper.isNumber = (str) => snq(() => /^[0-9]+$/i.test(str));
|
|
6
|
-
NumberHelper.convertToNumber = (str) => snq(() => Number(str));
|
|
7
|
-
NumberHelper.replaceNumber = (str) => snq(() => str.replace(/[^0-9]/g, ''));
|
|
8
|
-
NumberHelper.replaceFloat = (str) => snq(() => str.replace(/[^0-9.]/g, ''));
|
|
9
|
-
NumberHelper.toFixed = (num, fixed) => snq(() => num.toFixed(fixed));
|
|
10
|
-
NumberHelper.parseFloatFixed = (str, fixed) => snq(() => parseFloat(NumberHelper.replaceFloat(str)).toFixed(fixed));
|
|
11
|
-
NumberHelper.getDecimalLength = (str) => snq(() => str.split('.')[1] ? str.split('.')[1].length : 0);
|
|
12
|
-
|
|
13
|
-
export { NumberHelper as N };
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { S as StringHelper } from './string-helper-414d635d.js';
|
|
2
|
-
|
|
3
|
-
const opposites = {
|
|
4
|
-
left: 'right',
|
|
5
|
-
right: 'left',
|
|
6
|
-
top: 'bottom',
|
|
7
|
-
bottom: 'top'
|
|
8
|
-
};
|
|
9
|
-
const join = (places) => {
|
|
10
|
-
if (places.length === 1) {
|
|
11
|
-
return opposites[places[0]];
|
|
12
|
-
}
|
|
13
|
-
return [opposites[places[0]], places[1]].join('-');
|
|
14
|
-
};
|
|
15
|
-
const getPlacement = async (box, host, placement, changePlacement) => {
|
|
16
|
-
const { width, height } = box.getBoundingClientRect();
|
|
17
|
-
const { left, right, top, bottom } = host.getBoundingClientRect();
|
|
18
|
-
const places = StringHelper.textContains(placement, '-') ? placement.split('-') : placement.split(' ');
|
|
19
|
-
const bodyWidth = document.documentElement.clientWidth;
|
|
20
|
-
const bodyHeight = document.documentElement.clientHeight;
|
|
21
|
-
switch (places[0]) {
|
|
22
|
-
case 'left':
|
|
23
|
-
if (left < (width + 8)) {
|
|
24
|
-
changePlacement(join(places));
|
|
25
|
-
}
|
|
26
|
-
break;
|
|
27
|
-
case 'right':
|
|
28
|
-
if (bodyWidth < (right + width + 8)) {
|
|
29
|
-
changePlacement(join(places));
|
|
30
|
-
}
|
|
31
|
-
break;
|
|
32
|
-
case 'top':
|
|
33
|
-
if (top < (height + 8)) {
|
|
34
|
-
changePlacement(join(places));
|
|
35
|
-
}
|
|
36
|
-
break;
|
|
37
|
-
case 'bottom':
|
|
38
|
-
if (bodyHeight < (bottom + height + 8)) {
|
|
39
|
-
changePlacement(join(places));
|
|
40
|
-
}
|
|
41
|
-
break;
|
|
42
|
-
default:
|
|
43
|
-
break;
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
const setPosition = (placement, target) => {
|
|
47
|
-
const { offsetTop, offsetHeight, offsetWidth, offsetLeft } = target;
|
|
48
|
-
const rect = target.getBoundingClientRect();
|
|
49
|
-
const top = offsetTop || (rect.top + window.pageYOffset);
|
|
50
|
-
const left = offsetLeft || (rect.left + window.pageXOffset);
|
|
51
|
-
const height = offsetHeight || rect.height;
|
|
52
|
-
const width = offsetWidth || rect.width;
|
|
53
|
-
const places = StringHelper.textContains(placement, '-') ? placement.split('-') : placement.split(' ');
|
|
54
|
-
switch (places[0]) {
|
|
55
|
-
case 'left':
|
|
56
|
-
switch (places[1]) {
|
|
57
|
-
case 'start':
|
|
58
|
-
return [top, left];
|
|
59
|
-
case 'end':
|
|
60
|
-
return [top + height, left];
|
|
61
|
-
default:
|
|
62
|
-
return [top + (height / 2), left];
|
|
63
|
-
}
|
|
64
|
-
case 'right':
|
|
65
|
-
switch (places[1]) {
|
|
66
|
-
case 'start':
|
|
67
|
-
return [top, left + width];
|
|
68
|
-
case 'end':
|
|
69
|
-
return [top + height, left + width];
|
|
70
|
-
default:
|
|
71
|
-
return [top + (height / 2), left + width];
|
|
72
|
-
}
|
|
73
|
-
case 'top':
|
|
74
|
-
switch (places[1]) {
|
|
75
|
-
case 'start':
|
|
76
|
-
return [top, left];
|
|
77
|
-
case 'end':
|
|
78
|
-
return [top, left + width];
|
|
79
|
-
default:
|
|
80
|
-
return [top, left + width / 2];
|
|
81
|
-
}
|
|
82
|
-
case 'bottom':
|
|
83
|
-
switch (places[1]) {
|
|
84
|
-
case 'start':
|
|
85
|
-
return [top + height, left];
|
|
86
|
-
case 'end':
|
|
87
|
-
return [top + height, left + width];
|
|
88
|
-
default:
|
|
89
|
-
return [top + height, left + width / 2];
|
|
90
|
-
}
|
|
91
|
-
default:
|
|
92
|
-
break;
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
export { getPlacement as g, setPosition as s };
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { g as getElement } from './index-dbc63c66.js';
|
|
2
|
-
|
|
3
|
-
function AttrReflect(attribute) {
|
|
4
|
-
return (proto, propName) => {
|
|
5
|
-
const { connectedCallback } = proto;
|
|
6
|
-
proto.connectedCallback = function () {
|
|
7
|
-
const host = getElement(this);
|
|
8
|
-
registerAttrReflect(this, host, propName, attribute);
|
|
9
|
-
return connectedCallback && connectedCallback.call(this);
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
function registerAttrReflect(component, element, propName, attribute) {
|
|
14
|
-
if ("IntersectionObserver" in window) {
|
|
15
|
-
let io = new IntersectionObserver((data) => {
|
|
16
|
-
if (data[0].isIntersecting) {
|
|
17
|
-
initProps(component, element, propName, attribute);
|
|
18
|
-
io.disconnect();
|
|
19
|
-
io = null;
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
io.observe(element);
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
// fall back to setTimeout for Safari and IE
|
|
26
|
-
setTimeout(() => {
|
|
27
|
-
initProps(component, element, propName, attribute);
|
|
28
|
-
}, 300);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
function initProps(component, element, propName, attribute) {
|
|
32
|
-
component[propName] = element[attribute];
|
|
33
|
-
element.removeAttribute(attribute);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export { AttrReflect as A };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { h } from './index-dbc63c66.js';
|
|
2
|
-
import { S as StringHelper } from './string-helper-414d635d.js';
|
|
3
|
-
|
|
4
|
-
const SlotTemplate = ({ value, className, name }) => {
|
|
5
|
-
return StringHelper.isNullOrEmpty(value) ? h("span", { class: className },
|
|
6
|
-
h("slot", Object.assign({}, (name && { name: name })))) : h("span", { class: className }, value);
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export { SlotTemplate as S };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
function snq(callback, defaultValue) {
|
|
2
|
-
try {
|
|
3
|
-
var result = callback();
|
|
4
|
-
return typeof result === 'undefined' ? defaultValue : result;
|
|
5
|
-
}
|
|
6
|
-
catch (err) {
|
|
7
|
-
if (err instanceof TypeError) {
|
|
8
|
-
return defaultValue;
|
|
9
|
-
}
|
|
10
|
-
throw err;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export { snq as s };
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { B as Bcm } from './bcm-ad02f9c9.js';
|
|
2
|
-
|
|
3
|
-
class StringHelper {
|
|
4
|
-
}
|
|
5
|
-
StringHelper.lowercase = (str) => str.toLowerCase();
|
|
6
|
-
StringHelper.uppercase = (str) => str.toUpperCase();
|
|
7
|
-
StringHelper.capitalize = (str) => str.charAt(0).toUpperCase() + str.slice(1);
|
|
8
|
-
StringHelper.camelCase = (str) => str.replace(/\s(.)/g, function ($1) { return $1.toUpperCase(); }).replace(/\s/g, '');
|
|
9
|
-
StringHelper.kebabCase = (str) => str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
|
|
10
|
-
StringHelper.snakeCase = (str) => str.replace(/([a-z])([A-Z])/g, '$1_$2').toLowerCase();
|
|
11
|
-
StringHelper.titleCase = (str) => str.replace(/\w\S*/g, function (txt) { return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase(); });
|
|
12
|
-
StringHelper.trim = (str) => str.trim();
|
|
13
|
-
StringHelper.trimLeft = (str) => str.trimLeft();
|
|
14
|
-
StringHelper.trimRight = (str) => str.trimRight();
|
|
15
|
-
StringHelper.trimAll = (str) => str.trim().replace(/\s+/g, ' ');
|
|
16
|
-
StringHelper.replace = (str, search, replace) => str.replace(search, replace);
|
|
17
|
-
StringHelper.remove = (str, search) => str.replace(search, '');
|
|
18
|
-
StringHelper.isNullOrEmpty = (str) => str === null || str === undefined || str === '';
|
|
19
|
-
StringHelper.localizationMessage = (str, args) => str.replace(/{(\d+)}/g, (match, number) => typeof args[number] != 'undefined' ? args[number] : match);
|
|
20
|
-
StringHelper.getMessage = (type, args) => StringHelper.localizationMessage(Bcm.FormErrorMessages[type], args);
|
|
21
|
-
StringHelper.split = (str, separator) => str.split(separator);
|
|
22
|
-
StringHelper.textContains = (str, search) => str.indexOf(search) !== -1;
|
|
23
|
-
StringHelper.textLimitter = (str, limit) => (str && str.length > limit) ? str.substring(0, limit) + '...' : str;
|
|
24
|
-
|
|
25
|
-
export { StringHelper as S };
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
const variantOptions = {
|
|
2
|
-
save: {
|
|
3
|
-
text: 'Save',
|
|
4
|
-
class: 'success',
|
|
5
|
-
icon: 'save',
|
|
6
|
-
iconPosition: 'prefix',
|
|
7
|
-
},
|
|
8
|
-
ok: {
|
|
9
|
-
text: 'Ok',
|
|
10
|
-
class: 'success',
|
|
11
|
-
icon: 'check',
|
|
12
|
-
iconPosition: 'prefix',
|
|
13
|
-
},
|
|
14
|
-
new: {
|
|
15
|
-
text: 'New',
|
|
16
|
-
class: 'success',
|
|
17
|
-
icon: 'plus',
|
|
18
|
-
iconPosition: 'prefix',
|
|
19
|
-
},
|
|
20
|
-
add: {
|
|
21
|
-
text: 'Add',
|
|
22
|
-
class: 'success',
|
|
23
|
-
icon: 'plus',
|
|
24
|
-
iconPosition: 'prefix',
|
|
25
|
-
},
|
|
26
|
-
create: {
|
|
27
|
-
text: 'Create',
|
|
28
|
-
class: 'success',
|
|
29
|
-
icon: 'form',
|
|
30
|
-
iconPosition: 'prefix',
|
|
31
|
-
},
|
|
32
|
-
prev: {
|
|
33
|
-
text: 'Prev',
|
|
34
|
-
class: '',
|
|
35
|
-
icon: 'arrow-left',
|
|
36
|
-
iconPosition: 'prefix',
|
|
37
|
-
},
|
|
38
|
-
next: {
|
|
39
|
-
text: 'Next',
|
|
40
|
-
class: '',
|
|
41
|
-
icon: 'arrow-right',
|
|
42
|
-
iconPosition: 'suffix',
|
|
43
|
-
},
|
|
44
|
-
apply: {
|
|
45
|
-
text: 'Apply',
|
|
46
|
-
class: '',
|
|
47
|
-
icon: 'check-circle',
|
|
48
|
-
iconPosition: 'prefix',
|
|
49
|
-
},
|
|
50
|
-
submit: {
|
|
51
|
-
text: 'Submit',
|
|
52
|
-
class: '',
|
|
53
|
-
icon: 'save',
|
|
54
|
-
iconPosition: 'prefix',
|
|
55
|
-
},
|
|
56
|
-
send: {
|
|
57
|
-
text: 'Send',
|
|
58
|
-
class: 'success',
|
|
59
|
-
icon: 'send',
|
|
60
|
-
iconPosition: 'prefix',
|
|
61
|
-
},
|
|
62
|
-
delete: {
|
|
63
|
-
text: 'Delete',
|
|
64
|
-
class: 'warning',
|
|
65
|
-
icon: 'delete',
|
|
66
|
-
iconPosition: 'prefix',
|
|
67
|
-
},
|
|
68
|
-
cancel: {
|
|
69
|
-
text: 'Cancel',
|
|
70
|
-
class: 'warning',
|
|
71
|
-
icon: 'close',
|
|
72
|
-
iconPosition: 'prefix',
|
|
73
|
-
},
|
|
74
|
-
decline: {
|
|
75
|
-
text: 'Decline',
|
|
76
|
-
class: 'warning',
|
|
77
|
-
icon: 'stop',
|
|
78
|
-
iconPosition: 'prefix',
|
|
79
|
-
},
|
|
80
|
-
close: {
|
|
81
|
-
text: 'Close',
|
|
82
|
-
class: 'warning',
|
|
83
|
-
icon: 'close-circle',
|
|
84
|
-
iconPosition: 'prefix',
|
|
85
|
-
},
|
|
86
|
-
archive: {
|
|
87
|
-
text: 'Archive',
|
|
88
|
-
class: 'warning',
|
|
89
|
-
icon: 'folder-open',
|
|
90
|
-
iconPosition: 'prefix',
|
|
91
|
-
},
|
|
92
|
-
remove: {
|
|
93
|
-
text: 'Remove',
|
|
94
|
-
class: 'warning',
|
|
95
|
-
icon: 'minus-circle',
|
|
96
|
-
iconPosition: 'prefix',
|
|
97
|
-
},
|
|
98
|
-
edit: {
|
|
99
|
-
text: 'Edit',
|
|
100
|
-
class: '',
|
|
101
|
-
icon: 'edit',
|
|
102
|
-
iconPosition: 'prefix',
|
|
103
|
-
},
|
|
104
|
-
export: {
|
|
105
|
-
text: 'Export',
|
|
106
|
-
class: '',
|
|
107
|
-
icon: 'export',
|
|
108
|
-
iconPosition: 'prefix',
|
|
109
|
-
},
|
|
110
|
-
import: {
|
|
111
|
-
text: 'Import',
|
|
112
|
-
class: '',
|
|
113
|
-
icon: 'import',
|
|
114
|
-
iconPosition: 'prefix',
|
|
115
|
-
},
|
|
116
|
-
filter: {
|
|
117
|
-
text: 'Filter',
|
|
118
|
-
class: '',
|
|
119
|
-
icon: 'filter',
|
|
120
|
-
iconPosition: 'prefix',
|
|
121
|
-
},
|
|
122
|
-
update: {
|
|
123
|
-
text: 'Update',
|
|
124
|
-
class: '',
|
|
125
|
-
icon: 'sync',
|
|
126
|
-
iconPosition: 'prefix',
|
|
127
|
-
},
|
|
128
|
-
download: {
|
|
129
|
-
text: 'Download',
|
|
130
|
-
class: '',
|
|
131
|
-
icon: 'download',
|
|
132
|
-
iconPosition: 'prefix',
|
|
133
|
-
},
|
|
134
|
-
};
|
|
135
|
-
var VariantProps;
|
|
136
|
-
(function (VariantProps) {
|
|
137
|
-
VariantProps["save"] = "save";
|
|
138
|
-
VariantProps["ok"] = "ok";
|
|
139
|
-
VariantProps["new"] = "new";
|
|
140
|
-
VariantProps["add"] = "add";
|
|
141
|
-
VariantProps["create"] = "create";
|
|
142
|
-
VariantProps["apply"] = "apply";
|
|
143
|
-
VariantProps["prev"] = "prev";
|
|
144
|
-
VariantProps["next"] = "next";
|
|
145
|
-
VariantProps["send"] = "send";
|
|
146
|
-
VariantProps["delete"] = "delete";
|
|
147
|
-
VariantProps["cancel"] = "cancel";
|
|
148
|
-
VariantProps["decline"] = "decline";
|
|
149
|
-
VariantProps["close"] = "close";
|
|
150
|
-
VariantProps["archive"] = "archive";
|
|
151
|
-
VariantProps["remove"] = "remove";
|
|
152
|
-
VariantProps["edit"] = "edit";
|
|
153
|
-
VariantProps["export"] = "export";
|
|
154
|
-
VariantProps["import"] = "import";
|
|
155
|
-
VariantProps["filter"] = "filter";
|
|
156
|
-
VariantProps["update"] = "update";
|
|
157
|
-
VariantProps["download"] = "download";
|
|
158
|
-
})(VariantProps || (VariantProps = {}));
|
|
159
|
-
const iconSizes = {
|
|
160
|
-
default: {
|
|
161
|
-
large: 16,
|
|
162
|
-
medium: 14,
|
|
163
|
-
small: 14,
|
|
164
|
-
},
|
|
165
|
-
iconOnly: {
|
|
166
|
-
large: 20,
|
|
167
|
-
medium: 18,
|
|
168
|
-
small: 16,
|
|
169
|
-
},
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
export { iconSizes as i, variantOptions as v };
|