@htmlplus/element 3.4.0 → 3.4.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/client.d.ts +3 -5
- package/dist/client.js +5 -17
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -320,6 +320,8 @@ declare const host: (target: HTMLElement | HTMLPlusElement) => HTMLElement;
|
|
|
320
320
|
*/
|
|
321
321
|
declare const isCSSColor: (input: string) => boolean;
|
|
322
322
|
|
|
323
|
+
declare const isCSSUnit: (input: string) => boolean;
|
|
324
|
+
|
|
323
325
|
/**
|
|
324
326
|
* Indicates whether the direction of the element is `Right-To-Left` or not.
|
|
325
327
|
*/
|
|
@@ -343,10 +345,6 @@ type Slots = {
|
|
|
343
345
|
*/
|
|
344
346
|
declare const slots: (target: HTMLElement | HTMLPlusElement) => Slots;
|
|
345
347
|
|
|
346
|
-
declare const toCSSColor: (input: string) => string | undefined;
|
|
347
|
-
|
|
348
|
-
declare const toCSSUnit: (input?: number | string | null) => string | undefined;
|
|
349
|
-
|
|
350
348
|
/**
|
|
351
349
|
* Converts a value to a unit.
|
|
352
350
|
*/
|
|
@@ -379,5 +377,5 @@ declare const html: ((template: any, ...values: any[]) => Hole) & {
|
|
|
379
377
|
};
|
|
380
378
|
declare const styles: (input: object) => string;
|
|
381
379
|
|
|
382
|
-
export { Bind, Consumer, Debounce, Direction$1 as Direction, Element$1 as Element, Event, Host, IsRTL, Listen, Method, Overrides, Property, Provider, Query, QueryAll, Slots$1 as Slots, State, Style, Variant, Watch, attributes as a, classes, direction, dispatch, getConfig, getConfigCreator, html as h, host, isCSSColor, isRTL, off, on, query, queryAll, styles as s, setConfig, setConfigCreator, slots,
|
|
380
|
+
export { Bind, Consumer, Debounce, Direction$1 as Direction, Element$1 as Element, Event, Host, IsRTL, Listen, Method, Overrides, Property, Provider, Query, QueryAll, Slots$1 as Slots, State, Style, Variant, Watch, attributes as a, classes, direction, dispatch, getConfig, getConfigCreator, html as h, host, isCSSColor, isCSSUnit, isRTL, off, on, query, queryAll, styles as s, setConfig, setConfigCreator, slots, toUnit };
|
|
383
381
|
export type { Config, ConfigOptions, EventEmitter, EventOptions, ListenOptions, OverridableValue, OverridesConfig, PropertyOptions };
|
package/dist/client.js
CHANGED
|
@@ -267,6 +267,10 @@ const isCSSColor = (input) => {
|
|
|
267
267
|
return option.style.color !== '';
|
|
268
268
|
};
|
|
269
269
|
|
|
270
|
+
const isCSSUnit = (input) => {
|
|
271
|
+
return /^\d+(\.\d+)?(px|pt|cm|mm|in|em|rem|%|vw|vh)$/.test(input);
|
|
272
|
+
};
|
|
273
|
+
|
|
270
274
|
/**
|
|
271
275
|
* Indicates whether the direction of the element is `Right-To-Left` or not.
|
|
272
276
|
*/
|
|
@@ -1215,22 +1219,6 @@ const styles$1 = (input) => {
|
|
|
1215
1219
|
.join('; ');
|
|
1216
1220
|
};
|
|
1217
1221
|
|
|
1218
|
-
const toCSSColor = (input) => {
|
|
1219
|
-
return isCSSColor(input) ? input : undefined;
|
|
1220
|
-
};
|
|
1221
|
-
|
|
1222
|
-
const toCSSUnit = (input) => {
|
|
1223
|
-
if (input === undefined || input === null || input === '') {
|
|
1224
|
-
return;
|
|
1225
|
-
}
|
|
1226
|
-
if (typeof input === 'number' || (typeof input === 'string' && !Number.isNaN(Number(input)))) {
|
|
1227
|
-
return `${input}px`;
|
|
1228
|
-
}
|
|
1229
|
-
if (/^\d+(\.\d+)?(px|pt|cm|mm|in|em|rem|%|vw|vh)$/.test(input)) {
|
|
1230
|
-
return input;
|
|
1231
|
-
}
|
|
1232
|
-
};
|
|
1233
|
-
|
|
1234
1222
|
function toDecorator(util, ...args) {
|
|
1235
1223
|
return (target, key) => {
|
|
1236
1224
|
defineProperty(target, key, {
|
|
@@ -2194,4 +2182,4 @@ const attributes = attributes$2;
|
|
|
2194
2182
|
const html = html$1;
|
|
2195
2183
|
const styles = styles$1;
|
|
2196
2184
|
|
|
2197
|
-
export { Bind, Consumer, Debounce, Direction, Element, Event, Host, IsRTL, Listen, Method, Overrides, Property, Provider, Query, QueryAll, Slots, State, Style, Variant, Watch, attributes as a, classes, direction, dispatch, getConfig, getConfigCreator, html as h, host, isCSSColor, isRTL, off, on, query, queryAll, styles as s, setConfig, setConfigCreator, slots,
|
|
2185
|
+
export { Bind, Consumer, Debounce, Direction, Element, Event, Host, IsRTL, Listen, Method, Overrides, Property, Provider, Query, QueryAll, Slots, State, Style, Variant, Watch, attributes as a, classes, direction, dispatch, getConfig, getConfigCreator, html as h, host, isCSSColor, isCSSUnit, isRTL, off, on, query, queryAll, styles as s, setConfig, setConfigCreator, slots, toUnit };
|