@leavittsoftware/web 6.2.6 → 6.3.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/app/app-width-limiter.js +2 -0
- package/leavitt/app/app-width-limiter.js.map +1 -1
- package/package.json +2 -2
- package/titanium/duration-input/filled-duration-input.d.ts +31 -0
- package/titanium/duration-input/filled-duration-input.js +123 -0
- package/titanium/duration-input/filled-duration-input.js.map +1 -0
- package/titanium/duration-input/outlined-duration-input.d.ts +30 -0
- package/titanium/duration-input/outlined-duration-input.js +109 -0
- package/titanium/duration-input/outlined-duration-input.js.map +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-width-limiter.js","sourceRoot":"","sources":["app-width-limiter.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAGrD,IAAM,sBAAsB,GAA5B,MAAM,sBAAuB,SAAQ,UAAU;IACS,6BAAmB,OAAO,CAAC;IAA3B,IAAA,QAAQ,8CAAmB;IAA3B,IAAA,QAAQ,oDAAmB;aAEjF,WAAM,GAAG;QACd,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"app-width-limiter.js","sourceRoot":"","sources":["app-width-limiter.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAGrD,IAAM,sBAAsB,GAA5B,MAAM,sBAAuB,SAAQ,UAAU;IACS,6BAAmB,OAAO,CAAC;IAA3B,IAAA,QAAQ,8CAAmB;IAA3B,IAAA,QAAQ,oDAAmB;aAEjF,WAAM,GAAG;QACd,GAAG,CAAA;;;;;;;;;;KAUF;KACF,AAZY,CAYX;IAEF,MAAM;QACJ,OAAO,IAAI,CAAA;;;uBAGQ,IAAI,CAAC,QAAQ;;;;KAI/B,CAAC;IACJ,CAAC;;AAzB4D;IAA5D,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;sDAAqC;AAD7E,sBAAsB;IADlC,aAAa,CAAC,2BAA2B,CAAC;GAC9B,sBAAsB,CA2BlC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leavittsoftware/web",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.3.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"files": [
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"url": "https://github.com/LeavittSoftware/titanium-elements/issues"
|
|
43
43
|
},
|
|
44
44
|
"homepage": "https://github.com/LeavittSoftware/titanium-elements/#readme",
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "c1e498ae54e8839966e81789334d255b84bec345"
|
|
46
46
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { PropertyValues } from 'lit';
|
|
2
|
+
import { MdFilledTextField } from '@material/web/textfield/filled-text-field';
|
|
3
|
+
import duration from 'dayjs/esm/plugin/duration';
|
|
4
|
+
/**
|
|
5
|
+
* titanium-filled-duration-input is a human readable duration textfield.
|
|
6
|
+
*
|
|
7
|
+
* @element titanium-filled-duration-input
|
|
8
|
+
*
|
|
9
|
+
* @fires duration-change The duration can be accessed via event.target.duration
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
export declare class TitaniumFilledDurationInput extends MdFilledTextField {
|
|
13
|
+
#private;
|
|
14
|
+
/**
|
|
15
|
+
* Dayjs duration object. This is the main property you will interact with because the value
|
|
16
|
+
* property of this component is actually the human readable string and not the duration you most likely
|
|
17
|
+
* want to work with. When changed a duration-change event will be dispatched.
|
|
18
|
+
*/
|
|
19
|
+
accessor duration: duration.Duration | null;
|
|
20
|
+
label: string;
|
|
21
|
+
supportingText: string;
|
|
22
|
+
autocomplete: string;
|
|
23
|
+
spellcheck: boolean;
|
|
24
|
+
updated(changedProps: PropertyValues<this>): void;
|
|
25
|
+
firstUpdated(): void;
|
|
26
|
+
checkValidity(): boolean;
|
|
27
|
+
reportValidity(): boolean;
|
|
28
|
+
reset(): Promise<void>;
|
|
29
|
+
static styles: import("lit").CSSResultOrNative[];
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=filled-duration-input.d.ts.map
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { property, customElement } from 'lit/decorators.js';
|
|
3
|
+
import { css } from 'lit';
|
|
4
|
+
import { MdFilledTextField } from '@material/web/textfield/filled-text-field';
|
|
5
|
+
import dayjs from 'dayjs/esm';
|
|
6
|
+
import duration from 'dayjs/esm/plugin/duration';
|
|
7
|
+
import humanInterval, { durationToString } from './human-interval';
|
|
8
|
+
dayjs.extend(duration);
|
|
9
|
+
/**
|
|
10
|
+
* titanium-filled-duration-input is a human readable duration textfield.
|
|
11
|
+
*
|
|
12
|
+
* @element titanium-filled-duration-input
|
|
13
|
+
*
|
|
14
|
+
* @fires duration-change The duration can be accessed via event.target.duration
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
let TitaniumFilledDurationInput = class TitaniumFilledDurationInput extends MdFilledTextField {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(...arguments);
|
|
20
|
+
this.#duration_accessor_storage = null;
|
|
21
|
+
this.label = 'Duration';
|
|
22
|
+
this.supportingText = 'Enter a duration ex. "3 hours and 30 minutes"';
|
|
23
|
+
this.autocomplete = 'off';
|
|
24
|
+
this.spellcheck = false;
|
|
25
|
+
}
|
|
26
|
+
#duration_accessor_storage;
|
|
27
|
+
/**
|
|
28
|
+
* Dayjs duration object. This is the main property you will interact with because the value
|
|
29
|
+
* property of this component is actually the human readable string and not the duration you most likely
|
|
30
|
+
* want to work with. When changed a duration-change event will be dispatched.
|
|
31
|
+
*/
|
|
32
|
+
get duration() { return this.#duration_accessor_storage; }
|
|
33
|
+
set duration(value) { this.#duration_accessor_storage = value; }
|
|
34
|
+
updated(changedProps) {
|
|
35
|
+
if (changedProps.has('duration') && changedProps.get('duration') !== this.duration) {
|
|
36
|
+
if (this.duration) {
|
|
37
|
+
this.value = durationToString(this.duration);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
this.duration = null;
|
|
41
|
+
this.value = '';
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
firstUpdated() {
|
|
46
|
+
this.addEventListener('change', () => {
|
|
47
|
+
this.reportValidity();
|
|
48
|
+
const dur = this.#textToInterval(this.value);
|
|
49
|
+
if (dur?.asMilliseconds() != this.duration?.asMilliseconds()) {
|
|
50
|
+
this.duration = dur;
|
|
51
|
+
this.dispatchEvent(new Event('duration-change'));
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
checkValidity() {
|
|
56
|
+
return super.checkValidity() && this.#customCheckValidity(this.value);
|
|
57
|
+
}
|
|
58
|
+
reportValidity() {
|
|
59
|
+
if (!this.#customCheckValidity(this.value)) {
|
|
60
|
+
this.error = true;
|
|
61
|
+
this.errorText = 'Duration was entered in an incorrect format. Try "3 hours and 30 minutes"';
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
this.error = false;
|
|
65
|
+
this.errorText = '';
|
|
66
|
+
}
|
|
67
|
+
return super.reportValidity();
|
|
68
|
+
}
|
|
69
|
+
#customCheckValidity(input) {
|
|
70
|
+
if (input && !this.#textToInterval(input)) {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
#textToInterval(input) {
|
|
78
|
+
if (!input) {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
const ms = humanInterval(input);
|
|
82
|
+
return isNaN(ms) ? null : dayjs.duration(ms, 'ms');
|
|
83
|
+
}
|
|
84
|
+
async reset() {
|
|
85
|
+
super.reset();
|
|
86
|
+
this.error = false;
|
|
87
|
+
this.errorText = '';
|
|
88
|
+
this.duration = null;
|
|
89
|
+
}
|
|
90
|
+
static { this.styles = [
|
|
91
|
+
...(Array.isArray(MdFilledTextField.styles) ? MdFilledTextField.styles : [MdFilledTextField.styles]),
|
|
92
|
+
css `
|
|
93
|
+
:host {
|
|
94
|
+
--md-filled-text-field-container-shape: 16px;
|
|
95
|
+
--md-filled-text-field-active-indicator-height: 0;
|
|
96
|
+
--md-filled-text-field-error-active-indicator-height: 0;
|
|
97
|
+
--md-filled-text-field-hover-active-indicator-height: 0;
|
|
98
|
+
--md-filled-text-field-focus-active-indicator-height: 0;
|
|
99
|
+
--md-filled-text-field-disabled-active-indicator-height: 0;
|
|
100
|
+
}
|
|
101
|
+
`,
|
|
102
|
+
]; }
|
|
103
|
+
};
|
|
104
|
+
__decorate([
|
|
105
|
+
property({ type: Object })
|
|
106
|
+
], TitaniumFilledDurationInput.prototype, "duration", null);
|
|
107
|
+
__decorate([
|
|
108
|
+
property({ type: String })
|
|
109
|
+
], TitaniumFilledDurationInput.prototype, "label", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
property({ type: String })
|
|
112
|
+
], TitaniumFilledDurationInput.prototype, "supportingText", void 0);
|
|
113
|
+
__decorate([
|
|
114
|
+
property({ type: String })
|
|
115
|
+
], TitaniumFilledDurationInput.prototype, "autocomplete", void 0);
|
|
116
|
+
__decorate([
|
|
117
|
+
property({ type: Boolean })
|
|
118
|
+
], TitaniumFilledDurationInput.prototype, "spellcheck", void 0);
|
|
119
|
+
TitaniumFilledDurationInput = __decorate([
|
|
120
|
+
customElement('titanium-filled-duration-input')
|
|
121
|
+
], TitaniumFilledDurationInput);
|
|
122
|
+
export { TitaniumFilledDurationInput };
|
|
123
|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AAC;QACD,MAAM,EAAE,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;QAChC,OAAO,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;IACrD,CAAC;IAEQ,KAAK,CAAC,KAAK;QAClB,KAAK,CAAC,KAAK,EAAE,CAAC;QACd,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QACpB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;IACvB,CAAC;aAEe,WAAM,GAAG;QACvB,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;QACpG,GAAG,CAAA;;;;;;;;;KASF;KACF,AAZqB,CAYpB;;AA/EmC;IAApC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2DAAoD;AACnD;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0DAA4B;AAC3B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mEAA0E;AACzE;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iEAA8B;AAC5B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;+DAA6B;AAV9C,2BAA2B;IADvC,aAAa,CAAC,gCAAgC,CAAC;GACnC,2BAA2B,CAsFvC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { PropertyValues } from 'lit';
|
|
2
|
+
import { MdOutlinedTextField } from '@material/web/textfield/outlined-text-field';
|
|
3
|
+
import duration from 'dayjs/esm/plugin/duration';
|
|
4
|
+
/**
|
|
5
|
+
* titanium-outlined-duration-input is a human readable duration textfield.
|
|
6
|
+
*
|
|
7
|
+
* @element titanium-outlined-duration-input
|
|
8
|
+
*
|
|
9
|
+
* @fires duration-change The duration can be accessed via event.target.duration
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
export declare class TitaniumOutlinedDurationInput extends MdOutlinedTextField {
|
|
13
|
+
#private;
|
|
14
|
+
/**
|
|
15
|
+
* Dayjs duration object. This is the main property you will interact with because the value
|
|
16
|
+
* property of this component is actually the human readable string and not the duration you most likely
|
|
17
|
+
* want to work with. When changed a duration-change event will be dispatched.
|
|
18
|
+
*/
|
|
19
|
+
accessor duration: duration.Duration | null;
|
|
20
|
+
label: string;
|
|
21
|
+
supportingText: string;
|
|
22
|
+
autocomplete: string;
|
|
23
|
+
spellcheck: boolean;
|
|
24
|
+
updated(changedProps: PropertyValues<this>): void;
|
|
25
|
+
firstUpdated(): void;
|
|
26
|
+
checkValidity(): boolean;
|
|
27
|
+
reportValidity(): boolean;
|
|
28
|
+
reset(): Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=outlined-duration-input.d.ts.map
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { property, customElement } from 'lit/decorators.js';
|
|
3
|
+
import { MdOutlinedTextField } from '@material/web/textfield/outlined-text-field';
|
|
4
|
+
import dayjs from 'dayjs/esm';
|
|
5
|
+
import duration from 'dayjs/esm/plugin/duration';
|
|
6
|
+
import humanInterval, { durationToString } from './human-interval';
|
|
7
|
+
dayjs.extend(duration);
|
|
8
|
+
/**
|
|
9
|
+
* titanium-outlined-duration-input is a human readable duration textfield.
|
|
10
|
+
*
|
|
11
|
+
* @element titanium-outlined-duration-input
|
|
12
|
+
*
|
|
13
|
+
* @fires duration-change The duration can be accessed via event.target.duration
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
let TitaniumOutlinedDurationInput = class TitaniumOutlinedDurationInput extends MdOutlinedTextField {
|
|
17
|
+
constructor() {
|
|
18
|
+
super(...arguments);
|
|
19
|
+
this.#duration_accessor_storage = null;
|
|
20
|
+
this.label = 'Duration';
|
|
21
|
+
this.supportingText = 'Enter a duration ex. "3 hours and 30 minutes"';
|
|
22
|
+
this.autocomplete = 'off';
|
|
23
|
+
this.spellcheck = false;
|
|
24
|
+
}
|
|
25
|
+
#duration_accessor_storage;
|
|
26
|
+
/**
|
|
27
|
+
* Dayjs duration object. This is the main property you will interact with because the value
|
|
28
|
+
* property of this component is actually the human readable string and not the duration you most likely
|
|
29
|
+
* want to work with. When changed a duration-change event will be dispatched.
|
|
30
|
+
*/
|
|
31
|
+
get duration() { return this.#duration_accessor_storage; }
|
|
32
|
+
set duration(value) { this.#duration_accessor_storage = value; }
|
|
33
|
+
updated(changedProps) {
|
|
34
|
+
if (changedProps.has('duration') && changedProps.get('duration') !== this.duration) {
|
|
35
|
+
if (this.duration) {
|
|
36
|
+
this.value = durationToString(this.duration);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
this.duration = null;
|
|
40
|
+
this.value = '';
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
firstUpdated() {
|
|
45
|
+
this.addEventListener('change', () => {
|
|
46
|
+
this.reportValidity();
|
|
47
|
+
const dur = this.#textToInterval(this.value);
|
|
48
|
+
if (dur?.asMilliseconds() != this.duration?.asMilliseconds()) {
|
|
49
|
+
this.duration = dur;
|
|
50
|
+
this.dispatchEvent(new Event('duration-change'));
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
checkValidity() {
|
|
55
|
+
return super.checkValidity() && this.#customCheckValidity(this.value);
|
|
56
|
+
}
|
|
57
|
+
reportValidity() {
|
|
58
|
+
if (!this.#customCheckValidity(this.value)) {
|
|
59
|
+
this.error = true;
|
|
60
|
+
this.errorText = 'Duration was entered in an incorrect format. Try "3 hours and 30 minutes"';
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
this.error = false;
|
|
64
|
+
this.errorText = '';
|
|
65
|
+
}
|
|
66
|
+
return super.reportValidity();
|
|
67
|
+
}
|
|
68
|
+
#customCheckValidity(input) {
|
|
69
|
+
if (input && !this.#textToInterval(input)) {
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
#textToInterval(input) {
|
|
77
|
+
if (!input) {
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
const ms = humanInterval(input);
|
|
81
|
+
return isNaN(ms) ? null : dayjs.duration(ms, 'ms');
|
|
82
|
+
}
|
|
83
|
+
async reset() {
|
|
84
|
+
super.reset();
|
|
85
|
+
this.error = false;
|
|
86
|
+
this.errorText = '';
|
|
87
|
+
this.duration = null;
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
__decorate([
|
|
91
|
+
property({ type: Object })
|
|
92
|
+
], TitaniumOutlinedDurationInput.prototype, "duration", null);
|
|
93
|
+
__decorate([
|
|
94
|
+
property({ type: String })
|
|
95
|
+
], TitaniumOutlinedDurationInput.prototype, "label", void 0);
|
|
96
|
+
__decorate([
|
|
97
|
+
property({ type: String })
|
|
98
|
+
], TitaniumOutlinedDurationInput.prototype, "supportingText", void 0);
|
|
99
|
+
__decorate([
|
|
100
|
+
property({ type: String })
|
|
101
|
+
], TitaniumOutlinedDurationInput.prototype, "autocomplete", void 0);
|
|
102
|
+
__decorate([
|
|
103
|
+
property({ type: Boolean })
|
|
104
|
+
], TitaniumOutlinedDurationInput.prototype, "spellcheck", void 0);
|
|
105
|
+
TitaniumOutlinedDurationInput = __decorate([
|
|
106
|
+
customElement('titanium-outlined-duration-input')
|
|
107
|
+
], TitaniumOutlinedDurationInput);
|
|
108
|
+
export { TitaniumOutlinedDurationInput };
|
|
109
|
+
//# sourceMappingURL=outlined-duration-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1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