@leavittsoftware/web 1.14.1 → 1.15.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/leavitt/theme/theme-preference-event.d.ts +4 -0
- package/leavitt/theme/theme-preference-event.js +5 -0
- package/leavitt/theme/theme-preference-event.js.map +1 -0
- package/leavitt/theme/theme-preference.d.ts +8 -0
- package/leavitt/theme/theme-preference.js +26 -0
- package/leavitt/theme/theme-preference.js.map +1 -0
- package/package.json +2 -2
- package/titanium/helpers/phone-numbers/format-phone-number-dashes.d.ts +2 -0
- package/titanium/helpers/phone-numbers/format-phone-number-dashes.js +9 -0
- package/titanium/helpers/phone-numbers/format-phone-number-dashes.js.map +1 -0
- package/titanium/helpers/phone-numbers/format-phone-number-dots.d.ts +2 -0
- package/titanium/helpers/phone-numbers/format-phone-number-dots.js +9 -0
- package/titanium/helpers/phone-numbers/format-phone-number-dots.js.map +1 -0
- package/titanium/helpers/phone-numbers/format-phone-number-numbers-only.d.ts +2 -0
- package/titanium/helpers/phone-numbers/format-phone-number-numbers-only.js +9 -0
- package/titanium/helpers/phone-numbers/format-phone-number-numbers-only.js.map +1 -0
- package/titanium/helpers/phone-numbers/format-phone-number.d.ts +2 -0
- package/titanium/helpers/phone-numbers/format-phone-number.js +9 -0
- package/titanium/helpers/phone-numbers/format-phone-number.js.map +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-preference-event.js","sourceRoot":"","sources":["theme-preference-event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAC9D,MAAM,oBAAoB,GAAG,IAAI,QAAQ,EAAgC,CAAC;AAC1E,MAAM,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC;AACpC,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export type Constructor<T = {}> = new (...args: any[]) => T;
|
|
3
|
+
export type ThemePreferenceOption = 'light' | 'dark';
|
|
4
|
+
export declare class ThemePreferenceInterface {
|
|
5
|
+
themePreference: 'light' | 'dark';
|
|
6
|
+
}
|
|
7
|
+
export declare const ThemePreference: <T extends Constructor<LitElement>>(superClass: T) => Constructor<ThemePreferenceInterface> & T;
|
|
8
|
+
//# sourceMappingURL=theme-preference.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { property } from 'lit/decorators.js';
|
|
3
|
+
import themePreferenceEvent from './theme-preference-event';
|
|
4
|
+
/*
|
|
5
|
+
Adds reflected attribute / property (theme-preference) to host that reflects
|
|
6
|
+
users currently selected theme preference
|
|
7
|
+
|
|
8
|
+
ex. css :host([theme-preference='dark'])
|
|
9
|
+
*/
|
|
10
|
+
export const ThemePreference = (superClass) => {
|
|
11
|
+
class ThemePreference extends superClass {
|
|
12
|
+
connectedCallback() {
|
|
13
|
+
super.connectedCallback();
|
|
14
|
+
themePreferenceEvent.subscribe('theme-preference', 'change', (themePreference) => {
|
|
15
|
+
this.themePreference = themePreference;
|
|
16
|
+
});
|
|
17
|
+
this.themePreference = document.firstElementChild?.getAttribute('data-theme') === 'light' ? 'light' : 'dark';
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
__decorate([
|
|
21
|
+
property({ attribute: 'theme-preference', reflect: true })
|
|
22
|
+
], ThemePreference.prototype, "themePreference", void 0);
|
|
23
|
+
// Cast return type to your mixin's interface intersected with the superClass type
|
|
24
|
+
return ThemePreference;
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=theme-preference.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-preference.js","sourceRoot":"","sources":["theme-preference.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,oBAAoB,MAAM,0BAA0B,CAAC;AAW5D;;;;;EAKE;AACF,MAAM,CAAC,MAAM,eAAe,GAAG,CAAoC,UAAa,EAAE,EAAE;IAClF,MAAM,eAAgB,SAAQ,UAAU;QAGtC,iBAAiB;YACf,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC1B,oBAAoB,CAAC,SAAS,CAAC,kBAAkB,EAAE,QAAQ,EAAE,CAAC,eAAsC,EAAE,EAAE;gBACtG,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;YACzC,CAAC,CAAC,CAAC;YACH,IAAI,CAAC,eAAe,GAAG,QAAQ,CAAC,iBAAiB,EAAE,YAAY,CAAC,YAAY,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;QAC/G,CAAC;KACF;IAT6D;QAA3D,QAAQ,CAAC,EAAE,SAAS,EAAE,kBAAkB,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;4DAAwC;IAUrG,kFAAkF;IAClF,OAAO,eAA4D,CAAC;AACtE,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leavittsoftware/web",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.15.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"files": [
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"url": "https://github.com/LeavittSoftware/titanium-elements/issues"
|
|
40
40
|
},
|
|
41
41
|
"homepage": "https://github.com/LeavittSoftware/titanium-elements/#readme",
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "0a1ebcd59e4431c4ade0c392243397060051ebd7"
|
|
43
43
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export function formatPhoneNumberDashes(phoneNumberString) {
|
|
2
|
+
const cleaned = ('' + phoneNumberString).replace(/\D/g, '');
|
|
3
|
+
const match = cleaned.match(/^(\d{3})(\d{3})(\d{4})$/);
|
|
4
|
+
if (match) {
|
|
5
|
+
return match[1] + '-' + match[2] + '-' + match[3];
|
|
6
|
+
}
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=format-phone-number-dashes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-phone-number-dashes.js","sourceRoot":"","sources":["format-phone-number-dashes.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,uBAAuB,CAAC,iBAAyB;IAC/D,MAAM,OAAO,GAAG,CAAC,EAAE,GAAG,iBAAiB,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAC5D,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;IACvD,IAAI,KAAK,EAAE,CAAC;QACV,OAAO,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACpD,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export function formatPhoneNumberDots(phoneNumberString) {
|
|
2
|
+
const cleaned = ('' + phoneNumberString).replace(/\D/g, '');
|
|
3
|
+
const match = cleaned.match(/^(\d{3})(\d{3})(\d{4})$/);
|
|
4
|
+
if (match) {
|
|
5
|
+
return match[1] + '.' + match[2] + '.' + match[3];
|
|
6
|
+
}
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=format-phone-number-dots.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-phone-number-dots.js","sourceRoot":"","sources":["format-phone-number-dots.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,qBAAqB,CAAC,iBAAyB;IAC7D,MAAM,OAAO,GAAG,CAAC,EAAE,GAAG,iBAAiB,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAC5D,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;IACvD,IAAI,KAAK,EAAE,CAAC;QACV,OAAO,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACpD,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export function formatPhoneNumberNumbersOnly(phoneNumberString) {
|
|
2
|
+
const cleaned = ('' + phoneNumberString).replace(/\D/g, '');
|
|
3
|
+
const match = cleaned.match(/^(\d{3})(\d{3})(\d{4})$/);
|
|
4
|
+
if (match) {
|
|
5
|
+
return match[1] + match[2] + match[3];
|
|
6
|
+
}
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=format-phone-number-numbers-only.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-phone-number-numbers-only.js","sourceRoot":"","sources":["format-phone-number-numbers-only.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,4BAA4B,CAAC,iBAAyB;IACpE,MAAM,OAAO,GAAG,CAAC,EAAE,GAAG,iBAAiB,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAC5D,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;IACvD,IAAI,KAAK,EAAE,CAAC;QACV,OAAO,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACxC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export function formatPhoneNumber(phoneNumberString) {
|
|
2
|
+
const cleaned = ('' + phoneNumberString).replace(/\D/g, '');
|
|
3
|
+
const match = cleaned.match(/^(\d{3})(\d{3})(\d{4})$/);
|
|
4
|
+
if (match) {
|
|
5
|
+
return '(' + match[1] + ') ' + match[2] + '-' + match[3];
|
|
6
|
+
}
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=format-phone-number.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-phone-number.js","sourceRoot":"","sources":["format-phone-number.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,iBAAiB,CAAC,iBAAyB;IACzD,MAAM,OAAO,GAAG,CAAC,EAAE,GAAG,iBAAiB,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAC5D,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;IACvD,IAAI,KAAK,EAAE,CAAC;QACV,OAAO,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAC3D,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|