@operato/input 2.0.0-alpha.8 → 2.0.0-alpha.80
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/CHANGELOG.md +203 -0
- package/demo/index-multiple-colors.html +14 -2
- package/demo/index-partition-keys.html +13 -2
- package/demo/index-select.html +20 -9
- package/demo/index-table.html +13 -2
- package/demo/index.html +13 -2
- package/dist/src/locale/locale-picker.d.ts +1 -1
- package/dist/src/ox-buttons-radio.d.ts +1 -1
- package/dist/src/ox-checkbox.d.ts +4 -4
- package/dist/src/ox-input-3axis.d.ts +1 -1
- package/dist/src/ox-input-3dish.d.ts +1 -1
- package/dist/src/ox-input-angle.d.ts +1 -1
- package/dist/src/ox-input-barcode.d.ts +3 -4
- package/dist/src/ox-input-barcode.js +28 -42
- package/dist/src/ox-input-barcode.js.map +1 -1
- package/dist/src/ox-input-code.d.ts +2 -3
- package/dist/src/ox-input-code.js +8 -15
- package/dist/src/ox-input-code.js.map +1 -1
- package/dist/src/ox-input-color-gradient.d.ts +1 -1
- package/dist/src/ox-input-color-stops.d.ts +1 -1
- package/dist/src/ox-input-color.d.ts +1 -1
- package/dist/src/ox-input-container.d.ts +2 -2
- package/dist/src/ox-input-container.js +2 -2
- package/dist/src/ox-input-container.js.map +1 -1
- package/dist/src/ox-input-crontab.d.ts +1 -2
- package/dist/src/ox-input-crontab.js +4 -7
- package/dist/src/ox-input-crontab.js.map +1 -1
- package/dist/src/ox-input-data.d.ts +4 -5
- package/dist/src/ox-input-data.js +88 -36
- package/dist/src/ox-input-data.js.map +1 -1
- package/dist/src/ox-input-duration.d.ts +1 -2
- package/dist/src/ox-input-duration.js +13 -9
- package/dist/src/ox-input-duration.js.map +1 -1
- package/dist/src/ox-input-file.d.ts +2 -2
- package/dist/src/ox-input-file.js +10 -9
- package/dist/src/ox-input-file.js.map +1 -1
- package/dist/src/ox-input-hashtags.d.ts +1 -1
- package/dist/src/ox-input-i18n-label.d.ts +33 -0
- package/dist/src/ox-input-i18n-label.js +129 -0
- package/dist/src/ox-input-i18n-label.js.map +1 -0
- package/dist/src/ox-input-image.d.ts +2 -2
- package/dist/src/ox-input-image.js +4 -4
- package/dist/src/ox-input-image.js.map +1 -1
- package/dist/src/ox-input-key-values.d.ts +2 -2
- package/dist/src/ox-input-key-values.js +9 -10
- package/dist/src/ox-input-key-values.js.map +1 -1
- package/dist/src/ox-input-mass-fraction.d.ts +2 -2
- package/dist/src/ox-input-mass-fraction.js +46 -29
- package/dist/src/ox-input-mass-fraction.js.map +1 -1
- package/dist/src/ox-input-multiple-colors.d.ts +2 -2
- package/dist/src/ox-input-multiple-colors.js +7 -7
- package/dist/src/ox-input-multiple-colors.js.map +1 -1
- package/dist/src/ox-input-options.d.ts +2 -2
- package/dist/src/ox-input-options.js +5 -7
- package/dist/src/ox-input-options.js.map +1 -1
- package/dist/src/ox-input-partition-keys.d.ts +2 -2
- package/dist/src/ox-input-partition-keys.js +10 -10
- package/dist/src/ox-input-partition-keys.js.map +1 -1
- package/dist/src/ox-input-privilege.d.ts +1 -2
- package/dist/src/ox-input-privilege.js +15 -31
- package/dist/src/ox-input-privilege.js.map +1 -1
- package/dist/src/ox-input-quantifier.d.ts +1 -1
- package/dist/src/ox-input-scene-component-id.d.ts +1 -1
- package/dist/src/ox-input-search.d.ts +2 -2
- package/dist/src/ox-input-search.js +4 -4
- package/dist/src/ox-input-search.js.map +1 -1
- package/dist/src/ox-input-select-buttons.d.ts +1 -1
- package/dist/src/ox-input-stack.d.ts +1 -1
- package/dist/src/ox-input-table.d.ts +1 -1
- package/dist/src/ox-input-table.js +12 -12
- package/dist/src/ox-input-table.js.map +1 -1
- package/dist/src/ox-input-textarea.d.ts +1 -1
- package/dist/src/ox-input-unit-number.d.ts +2 -2
- package/dist/src/ox-input-unit-number.js +5 -4
- package/dist/src/ox-input-unit-number.js.map +1 -1
- package/dist/src/ox-input-value-map.d.ts +2 -2
- package/dist/src/ox-input-value-map.js +15 -15
- package/dist/src/ox-input-value-map.js.map +1 -1
- package/dist/src/ox-input-value-ranges.d.ts +2 -2
- package/dist/src/ox-input-value-ranges.js +15 -15
- package/dist/src/ox-input-value-ranges.js.map +1 -1
- package/dist/src/ox-input-work-shift.d.ts +1 -1
- package/dist/src/ox-input-work-shift.js +4 -5
- package/dist/src/ox-input-work-shift.js.map +1 -1
- package/dist/src/ox-select.d.ts +2 -2
- package/dist/src/ox-select.js +4 -4
- package/dist/src/ox-select.js.map +1 -1
- package/dist/stories/ox-input-3axis.stories.js +14 -1
- package/dist/stories/ox-input-3axis.stories.js.map +1 -1
- package/dist/stories/ox-input-3dish.stories.js +14 -1
- package/dist/stories/ox-input-3dish.stories.js.map +1 -1
- package/dist/stories/ox-input-angle.stories.js +13 -1
- package/dist/stories/ox-input-angle.stories.js.map +1 -1
- package/dist/stories/ox-input-barcode.stories.js +13 -1
- package/dist/stories/ox-input-barcode.stories.js.map +1 -1
- package/dist/stories/ox-input-code.stories.d.ts +4 -0
- package/dist/stories/ox-input-code.stories.js +18 -3
- package/dist/stories/ox-input-code.stories.js.map +1 -1
- package/dist/stories/ox-input-crontab.stories.js +13 -1
- package/dist/stories/ox-input-crontab.stories.js.map +1 -1
- package/dist/stories/ox-input-data.stories.d.ts +29 -0
- package/dist/stories/ox-input-data.stories.js +50 -0
- package/dist/stories/ox-input-data.stories.js.map +1 -0
- package/dist/stories/ox-input-duration.stories.js +13 -1
- package/dist/stories/ox-input-duration.stories.js.map +1 -1
- package/dist/stories/ox-input-file.stories.js +13 -1
- package/dist/stories/ox-input-file.stories.js.map +1 -1
- package/dist/stories/ox-input-hashtags.stories.js +13 -1
- package/dist/stories/ox-input-hashtags.stories.js.map +1 -1
- package/dist/stories/ox-input-i18n-label.stories.d.ts +29 -0
- package/dist/stories/ox-input-i18n-label.stories.js +70 -0
- package/dist/stories/ox-input-i18n-label.stories.js.map +1 -0
- package/dist/stories/ox-input-key-values.stories.js +13 -1
- package/dist/stories/ox-input-key-values.stories.js.map +1 -1
- package/dist/stories/ox-input-mass-fraction.stories.js +13 -1
- package/dist/stories/ox-input-mass-fraction.stories.js.map +1 -1
- package/dist/stories/ox-input-multiple-colors.stories.js +21 -10
- package/dist/stories/ox-input-multiple-colors.stories.js.map +1 -1
- package/dist/stories/ox-input-options.stories.js +13 -1
- package/dist/stories/ox-input-options.stories.js.map +1 -1
- package/dist/stories/ox-input-partition-keys.stories.js +13 -1
- package/dist/stories/ox-input-partition-keys.stories.js.map +1 -1
- package/dist/stories/ox-input-privilege.stories.js +13 -1
- package/dist/stories/ox-input-privilege.stories.js.map +1 -1
- package/dist/stories/ox-input-quantifier.stories.js +13 -1
- package/dist/stories/ox-input-quantifier.stories.js.map +1 -1
- package/dist/stories/ox-input-range.stories.js +13 -1
- package/dist/stories/ox-input-range.stories.js.map +1 -1
- package/dist/stories/ox-input-search.stories.js +13 -1
- package/dist/stories/ox-input-search.stories.js.map +1 -1
- package/dist/stories/ox-input-select-buttons.stories.js +13 -1
- package/dist/stories/ox-input-select-buttons.stories.js.map +1 -1
- package/dist/stories/ox-input-unit.stories.js +14 -1
- package/dist/stories/ox-input-unit.stories.js.map +1 -1
- package/dist/stories/ox-input-value-map.stories.js +13 -1
- package/dist/stories/ox-input-value-map.stories.js.map +1 -1
- package/dist/stories/ox-input-value-ranges.stories.js +13 -1
- package/dist/stories/ox-input-value-ranges.stories.js.map +1 -1
- package/dist/stories/ox-input-work-shift.stories.js +13 -1
- package/dist/stories/ox-input-work-shift.stories.js.map +1 -1
- package/dist/stories/ox-select.stories.js +13 -1
- package/dist/stories/ox-select.stories.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +25 -21
- package/src/ox-input-barcode.ts +31 -41
- package/src/ox-input-code.ts +6 -13
- package/src/ox-input-container.ts +2 -2
- package/src/ox-input-crontab.ts +4 -8
- package/src/ox-input-data.ts +97 -38
- package/src/ox-input-duration.ts +13 -10
- package/src/ox-input-file.ts +10 -9
- package/src/ox-input-i18n-label.ts +139 -0
- package/src/ox-input-image.ts +4 -4
- package/src/ox-input-key-values.ts +27 -22
- package/src/ox-input-mass-fraction.ts +46 -29
- package/src/ox-input-multiple-colors.ts +7 -7
- package/src/ox-input-options.ts +5 -7
- package/src/ox-input-partition-keys.ts +28 -22
- package/src/ox-input-privilege.ts +15 -32
- package/src/ox-input-search.ts +4 -4
- package/src/ox-input-table.ts +12 -12
- package/src/ox-input-unit-number.ts +5 -4
- package/src/ox-input-value-map.ts +17 -17
- package/src/ox-input-value-ranges.ts +17 -17
- package/src/ox-input-work-shift.ts +4 -5
- package/src/ox-select.ts +4 -4
- package/stories/ox-input-3axis.stories.ts +14 -1
- package/stories/ox-input-3dish.stories.ts +14 -1
- package/stories/ox-input-angle.stories.ts +13 -1
- package/stories/ox-input-barcode.stories.ts +13 -1
- package/stories/ox-input-code.stories.ts +25 -3
- package/stories/ox-input-crontab.stories.ts +13 -1
- package/stories/ox-input-data.stories.ts +65 -0
- package/stories/ox-input-duration.stories.ts +13 -1
- package/stories/ox-input-file.stories.ts +13 -1
- package/stories/ox-input-hashtags.stories.ts +13 -1
- package/stories/ox-input-i18n-label.stories.ts +85 -0
- package/stories/ox-input-key-values.stories.ts +13 -1
- package/stories/ox-input-mass-fraction.stories.ts +13 -1
- package/stories/ox-input-multiple-colors.stories.ts +21 -10
- package/stories/ox-input-options.stories.ts +13 -1
- package/stories/ox-input-partition-keys.stories.ts +13 -1
- package/stories/ox-input-privilege.stories.ts +13 -1
- package/stories/ox-input-quantifier.stories.ts +13 -1
- package/stories/ox-input-range.stories.ts +13 -1
- package/stories/ox-input-search.stories.ts +13 -1
- package/stories/ox-input-select-buttons.stories.ts +13 -1
- package/stories/ox-input-unit.stories.ts +14 -1
- package/stories/ox-input-value-map.stories.ts +13 -1
- package/stories/ox-input-value-ranges.stories.ts +13 -1
- package/stories/ox-input-work-shift.stories.ts +13 -1
- package/stories/ox-select.stories.ts +13 -1
@@ -9,7 +9,7 @@ WEB Component for code-mirror code editor.
|
|
9
9
|
|
10
10
|
Example:
|
11
11
|
|
12
|
-
<ox-input-code .value=${text}
|
12
|
+
<ox-input-code .value=${text} language="javascript" show-line-numbers>
|
13
13
|
</ox-input-code>
|
14
14
|
*/
|
15
15
|
export declare class OxInputCode extends OxFormField {
|
@@ -18,8 +18,7 @@ export declare class OxInputCode extends OxFormField {
|
|
18
18
|
* `value`는 에디터에서 작성중인 contents이다.
|
19
19
|
*/
|
20
20
|
value: string;
|
21
|
-
|
22
|
-
tabAsSpace: boolean;
|
21
|
+
showLineNumbers: boolean;
|
23
22
|
language?: string;
|
24
23
|
private _self_changing;
|
25
24
|
private _editor?;
|
@@ -4,8 +4,9 @@
|
|
4
4
|
import { __decorate } from "tslib";
|
5
5
|
import { css } from 'lit';
|
6
6
|
import { customElement, property } from 'lit/decorators.js';
|
7
|
+
import { minimalSetup } from 'codemirror';
|
7
8
|
import { history, historyKeymap, indentWithTab } from '@codemirror/commands';
|
8
|
-
import { EditorView, highlightActiveLine, keymap } from '@codemirror/view';
|
9
|
+
import { EditorView, highlightActiveLine, keymap, lineNumbers } from '@codemirror/view';
|
9
10
|
import { autocompletion, closeBrackets } from '@codemirror/autocomplete';
|
10
11
|
import { bracketMatching, syntaxHighlighting } from '@codemirror/language';
|
11
12
|
import { oneDarkHighlightStyle, oneDark } from '@codemirror/theme-one-dark';
|
@@ -20,7 +21,7 @@ WEB Component for code-mirror code editor.
|
|
20
21
|
|
21
22
|
Example:
|
22
23
|
|
23
|
-
<ox-input-code .value=${text}
|
24
|
+
<ox-input-code .value=${text} language="javascript" show-line-numbers>
|
24
25
|
</ox-input-code>
|
25
26
|
*/
|
26
27
|
let OxInputCode = class OxInputCode extends OxFormField {
|
@@ -30,8 +31,7 @@ let OxInputCode = class OxInputCode extends OxFormField {
|
|
30
31
|
* `value`는 에디터에서 작성중인 contents이다.
|
31
32
|
*/
|
32
33
|
this.value = '';
|
33
|
-
this.
|
34
|
-
this.tabAsSpace = true;
|
34
|
+
this.showLineNumbers = false;
|
35
35
|
this.language = 'javascript';
|
36
36
|
this._self_changing = false;
|
37
37
|
this._changed = false;
|
@@ -79,7 +79,9 @@ let OxInputCode = class OxInputCode extends OxFormField {
|
|
79
79
|
this._editor = new EditorView({
|
80
80
|
doc: this.value,
|
81
81
|
extensions: [
|
82
|
+
minimalSetup,
|
82
83
|
...language,
|
84
|
+
...(this.showLineNumbers ? [lineNumbers()] : []),
|
83
85
|
bracketMatching(),
|
84
86
|
closeBrackets(),
|
85
87
|
history(),
|
@@ -113,12 +115,6 @@ let OxInputCode = class OxInputCode extends OxFormField {
|
|
113
115
|
this.value = this._editor.state.doc.toString();
|
114
116
|
this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true, detail: this.value }));
|
115
117
|
});
|
116
|
-
// this._editor.contentDOM.addEventListener('change', async e => {
|
117
|
-
// this._self_changing = true
|
118
|
-
// this._changed = true
|
119
|
-
// await this.updateComplete
|
120
|
-
// this._self_changing = false
|
121
|
-
// })
|
122
118
|
return this._editor;
|
123
119
|
}
|
124
120
|
};
|
@@ -126,11 +122,8 @@ __decorate([
|
|
126
122
|
property({ type: String })
|
127
123
|
], OxInputCode.prototype, "value", void 0);
|
128
124
|
__decorate([
|
129
|
-
property({ type:
|
130
|
-
], OxInputCode.prototype, "
|
131
|
-
__decorate([
|
132
|
-
property({ type: Boolean, attribute: 'tab-as-space' })
|
133
|
-
], OxInputCode.prototype, "tabAsSpace", void 0);
|
125
|
+
property({ type: Boolean, attribute: 'show-line-numbers' })
|
126
|
+
], OxInputCode.prototype, "showLineNumbers", void 0);
|
134
127
|
__decorate([
|
135
128
|
property({ type: String })
|
136
129
|
], OxInputCode.prototype, "language", void 0);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ox-input-code.js","sourceRoot":"","sources":["../../src/ox-input-code.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,EAAE,GAAG,EAAkB,MAAM,KAAK,CAAA;AACzC,OAAO,EAAE,aAAa,EAAE,QAAQ,EA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,CAAC,KAAK,GAAG,IAAI,CAAC,OAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAA;YAC/C,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;QACtG,CAAC,CAAC,CAAA;QAEF,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;;AAjF2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CAAmB;AACe;IAA5D,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAAC;oDAAiC;AACjE;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAAiC;AAvBjD,WAAW;IADvB,aAAa,CAAC,eAAe,CAAC;GAClB,WAAW,CAuGvB","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport { css, PropertyValues } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { minimalSetup } from 'codemirror'\nimport { history, historyKeymap, indentWithTab } from '@codemirror/commands'\nimport { EditorView, highlightActiveLine, keymap, lineNumbers } from '@codemirror/view'\nimport { autocompletion, closeBrackets } from '@codemirror/autocomplete'\nimport { bracketMatching, LanguageSupport, syntaxHighlighting } from '@codemirror/language'\nimport { oneDarkHighlightStyle, oneDark } from '@codemirror/theme-one-dark'\n\nimport { javascript } from '@codemirror/lang-javascript'\nimport { sql } from '@codemirror/lang-sql'\nimport { json } from '@codemirror/lang-json'\n\nimport { ScrollbarStyles } from '@operato/styles'\nimport { togglefullscreen } from '@operato/utils'\n\nimport { OxFormField } from './ox-form-field'\n\n/**\nWEB Component for code-mirror code editor.\n\nExample:\n\n <ox-input-code .value=${text} language=\"javascript\" show-line-numbers>\n </ox-input-code>\n*/\n@customElement('ox-input-code')\nexport class OxInputCode extends OxFormField {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n position: relative;\n background: white;\n overflow: auto;\n }\n\n .cm-editor {\n flex: 1;\n }\n `\n ]\n\n /**\n * `value`는 에디터에서 작성중인 contents이다.\n */\n @property({ type: String }) value: string = ''\n @property({ type: Boolean, attribute: 'show-line-numbers' }) showLineNumbers: boolean = false\n @property({ type: String }) language?: string = 'javascript'\n\n private _self_changing: boolean = false\n private _editor?: EditorView\n private _changed: boolean = false\n\n updated(changes: PropertyValues<this>) {\n if (changes.has('value') && this.editor && !this._self_changing) {\n const to = this.editor.state.doc.toString().length\n this.editor.dispatch({\n changes: { from: 0, to, insert: this.value === undefined ? '' : String(this.value) }\n })\n }\n }\n\n get editor() {\n if (!this._editor) {\n let language: LanguageSupport[] = []\n switch (this.language) {\n case 'sql':\n language = [sql()]\n break\n case 'json':\n language = [json()]\n break\n case 'javascript':\n language = [javascript()]\n break\n default:\n break\n }\n\n this._editor = new EditorView({\n doc: this.value,\n extensions: [\n minimalSetup,\n ...language,\n ...(this.showLineNumbers ? [lineNumbers()] : []),\n bracketMatching(),\n closeBrackets(),\n history(),\n autocompletion(),\n oneDark,\n syntaxHighlighting(oneDarkHighlightStyle),\n highlightActiveLine(),\n keymap.of([...historyKeymap, indentWithTab]),\n EditorView.updateListener.of(async v => {\n if (v.docChanged) {\n this._self_changing = true\n this._changed = true\n\n await this.updateComplete\n\n this._self_changing = false\n }\n })\n ],\n parent: this.renderRoot\n })\n }\n\n this._editor.contentDOM.addEventListener('keydown', event => {\n event.stopPropagation()\n\n if (event.key === 'Escape') {\n togglefullscreen(this._editor!.contentDOM)\n }\n })\n\n this._editor.contentDOM.addEventListener('blur', e => {\n if (!this._changed) {\n return\n }\n\n this.value = this._editor!.state.doc.toString()\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true, detail: this.value }))\n })\n\n return this._editor\n }\n}\n"]}
|
@@ -21,6 +21,6 @@ export declare class OxInputColorGradient extends OxFormField {
|
|
21
21
|
value: GradientOption;
|
22
22
|
firstUpdated(): void;
|
23
23
|
_onChange(e: Event): void;
|
24
|
-
render(): import("lit").TemplateResult<1>;
|
24
|
+
render(): import("lit-html").TemplateResult<1>;
|
25
25
|
_convertDirectionToRotation(direction: string): number;
|
26
26
|
}
|
@@ -52,7 +52,7 @@ export declare class OxInputColorStops extends OxFormField {
|
|
52
52
|
connectedCallback(): void;
|
53
53
|
firstUpdated(): void;
|
54
54
|
updated(changes: PropertyValues<this>): void;
|
55
|
-
render(): import("lit").TemplateResult<1>;
|
55
|
+
render(): import("lit-html").TemplateResult<1>;
|
56
56
|
_refinedValue(value: any): any[];
|
57
57
|
_setFocused(index: number): void;
|
58
58
|
_changeFocused(focused: any): void;
|
@@ -165,7 +165,7 @@ export declare class OxInputColor extends OxFormField {
|
|
165
165
|
static styles: import("lit").CSSResult;
|
166
166
|
value?: string;
|
167
167
|
properties: any;
|
168
|
-
render(): import("lit").TemplateResult<1>;
|
168
|
+
render(): import("lit-html").TemplateResult<1>;
|
169
169
|
set colorString(colorString: string);
|
170
170
|
_thumbnail(): string;
|
171
171
|
_onInputChanged(e: Event): void;
|
@@ -1,12 +1,12 @@
|
|
1
1
|
/**
|
2
2
|
* @license Copyright © HatioLab Inc. All rights reserved.
|
3
3
|
*/
|
4
|
-
import '@material/
|
4
|
+
import '@material/web/icon/icon.js';
|
5
5
|
import '@operato/popup/ox-popup-list.js';
|
6
6
|
import { LitElement } from 'lit';
|
7
7
|
import { OxPopupList } from '@operato/popup';
|
8
8
|
export declare class OxInputContainer extends LitElement {
|
9
9
|
popupList: OxPopupList;
|
10
|
-
render(): import("lit").TemplateResult<1>;
|
10
|
+
render(): import("lit-html").TemplateResult<1>;
|
11
11
|
openPopupList(e: MouseEvent): void;
|
12
12
|
}
|
@@ -2,7 +2,7 @@
|
|
2
2
|
* @license Copyright © HatioLab Inc. All rights reserved.
|
3
3
|
*/
|
4
4
|
import { __decorate } from "tslib";
|
5
|
-
import '@material/
|
5
|
+
import '@material/web/icon/icon.js';
|
6
6
|
import '@operato/popup/ox-popup-list.js';
|
7
7
|
import { html, LitElement } from 'lit';
|
8
8
|
import { customElement, query } from 'lit/decorators.js';
|
@@ -10,7 +10,7 @@ let OxInputContainer = class OxInputContainer extends LitElement {
|
|
10
10
|
render() {
|
11
11
|
return html `
|
12
12
|
<slot> </slot>
|
13
|
-
<
|
13
|
+
<md-icon @click=${this.openPopupList.bind(this)}>menu</md-icon>
|
14
14
|
|
15
15
|
<ox-popup-list></ox-popup-list>
|
16
16
|
`;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ox-input-container.js","sourceRoot":"","sources":["../../src/ox-input-container.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,
|
1
|
+
{"version":3,"file":"ox-input-container.js","sourceRoot":"","sources":["../../src/ox-input-container.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,4BAA4B,CAAA;AACnC,OAAO,iCAAiC,CAAA;AAExC,OAAO,EAAO,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAKjD,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,UAAU;IAG9C,MAAM;QACJ,OAAO,IAAI,CAAA;;wBAES,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC;;;KAGhD,CAAA;IACH,CAAC;IAED,aAAa,CAAC,CAAa;QACzB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;YAClB,IAAI,EAAE,CAAC;YACP,GAAG,EAAE,CAAC;SACP,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAjByB;IAAvB,KAAK,CAAC,eAAe,CAAC;mDAAwB;AADpC,gBAAgB;IAD5B,aAAa,CAAC,oBAAoB,CAAC;GACvB,gBAAgB,CAkB5B","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport '@material/web/icon/icon.js'\nimport '@operato/popup/ox-popup-list.js'\n\nimport { css, html, LitElement } from 'lit'\nimport { customElement, query } from 'lit/decorators.js'\n\nimport { OxPopupList } from '@operato/popup'\n\n@customElement('ox-input-container')\nexport class OxInputContainer extends LitElement {\n @query('ox-popup-list') popupList!: OxPopupList\n\n render() {\n return html`\n <slot> </slot>\n <md-icon @click=${this.openPopupList.bind(this)}>menu</md-icon>\n\n <ox-popup-list></ox-popup-list>\n `\n }\n\n openPopupList(e: MouseEvent) {\n this.popupList.open({\n left: 0,\n top: 0\n })\n }\n}\n"]}
|
@@ -1,7 +1,6 @@
|
|
1
1
|
/**
|
2
2
|
* @license Copyright © HatioLab Inc. All rights reserved.
|
3
3
|
*/
|
4
|
-
import '@material/mwc-button';
|
5
4
|
import { PropertyValues } from 'lit';
|
6
5
|
import { OxFormField } from './ox-form-field';
|
7
6
|
export declare class OxInputCrontab extends OxFormField {
|
@@ -17,7 +16,7 @@ export declare class OxInputCrontab extends OxFormField {
|
|
17
16
|
value: string;
|
18
17
|
description: string;
|
19
18
|
}[];
|
20
|
-
render(): import("lit").TemplateResult<1>;
|
19
|
+
render(): import("lit-html").TemplateResult<1>;
|
21
20
|
get focusableElements(): HTMLElement[];
|
22
21
|
firstUpdated(): void;
|
23
22
|
updated(changes: PropertyValues<this>): void;
|
@@ -2,7 +2,6 @@
|
|
2
2
|
* @license Copyright © HatioLab Inc. All rights reserved.
|
3
3
|
*/
|
4
4
|
import { __decorate } from "tslib";
|
5
|
-
import '@material/mwc-button';
|
6
5
|
import { css, html } from 'lit';
|
7
6
|
import { customElement, property, state } from 'lit/decorators.js';
|
8
7
|
import { i18next } from '@operato/i18n';
|
@@ -205,14 +204,12 @@ let OxInputCrontab = class OxInputCrontab extends OxFormField {
|
|
205
204
|
margin: -0.25rem;
|
206
205
|
}
|
207
206
|
|
208
|
-
|
209
|
-
background-color: var(--secondary-color);
|
207
|
+
button {
|
210
208
|
border-radius: var(--button-border-radius);
|
211
|
-
--mdc-theme-primary: #fff;
|
212
209
|
margin: 0.25rem;
|
213
210
|
}
|
214
|
-
|
215
|
-
|
211
|
+
button:hover,
|
212
|
+
button:active {
|
216
213
|
background-color: var(--primary-color);
|
217
214
|
}
|
218
215
|
`; }
|
@@ -377,7 +374,7 @@ let OxInputCrontab = class OxInputCrontab extends OxFormField {
|
|
377
374
|
`;
|
378
375
|
}
|
379
376
|
get focusableElements() {
|
380
|
-
return Array.from(this.renderRoot.querySelectorAll('select, input,
|
377
|
+
return Array.from(this.renderRoot.querySelectorAll('select, input, button'));
|
381
378
|
}
|
382
379
|
firstUpdated() {
|
383
380
|
;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ox-input-crontab.js","sourceRoot":"","sources":["../../src/ox-input-crontab.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,sBAAsB,CAAA;AAE7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAEvC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAE7C,SAAS,eAAe,CAAC,IAA4D;IACnF,yDAAyD;IACzD,IAAI,YAAY,GAAG,EAAS,CAAA;IAC5B,YAAY,CAAC,KAAK,CAAC,GAAG,WAAW,CAAA;IACjC,YAAY,CAAC,KAAK,CAAC,GAAG,WAAW,CAAA;IACjC,YAAY,CAAC,MAAM,CAAC,GAAG,iBAAiB,CAAA;IACxC,YAAY,CAAC,KAAK,CAAC,GAAG,uBAAuB,CAAA;IAC7C,YAAY,CAAC,OAAO,CAAC,GAAG,cAAc,CAAA;IACtC,YAAY,CAAC,WAAW,CAAC,GAAG,OAAO,CAAA;IAEnC,IAAI,a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AQ,EAAE;YACxB,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;YACd,MAAM,EAAE,IAAI,CAAC,KAAK;SACnB,CAAC,CACH,CAAA;IACH,CAAC;;AAtW2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAAe;AACd;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAAgB;AACf;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAAgB;AACf;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAc;AACb;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDAAoB;AACnB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAAe;AACd;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iDAAmB;AAErC;IAAR,KAAK,EAAE;+CAAuD;AAtJpD,cAAc;IAD1B,aAAa,CAAC,kBAAkB,CAAC;GACrB,cAAc,CAqf1B","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport '@material/mwc-button'\n\nimport { css, html, PropertyValues } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { i18next } from '@operato/i18n'\n\nimport { OxFormField } from './ox-form-field'\n\nfunction createCronRegex(type: 'sec' | 'min' | 'hour' | 'day' | 'month' | 'dayOfWeek') {\n // https://gist.github.com/dkandalov/a2aed17cfdeb65243022\n var regexByField = {} as any\n regexByField['sec'] = '[0-5]?\\\\d'\n regexByField['min'] = '[0-5]?\\\\d'\n regexByField['hour'] = '[01]?\\\\d|2[0-3]'\n regexByField['day'] = '0?[1-9]|[12]\\\\d|3[01]'\n regexByField['month'] = '[1-9]|1[012]'\n regexByField['dayOfWeek'] = '[0-7]'\n\n var crontabFields = [type]\n if (!type) crontabFields = ['sec', 'min', 'hour', 'day', 'month', 'dayOfWeek']\n\n crontabFields.forEach(field => {\n var number = regexByField[field]\n var range =\n '(?:' +\n number +\n ')' +\n '(?:' +\n '(?:-|/|,' +\n ('dayOfWeek' === field ? '|#' : '') +\n ')' +\n '(?:' +\n number +\n ')' +\n ')?'\n if (field === 'dayOfWeek') range += '(?:L)?'\n if (field === 'month') range += '(?:L|W)?'\n regexByField[field] = '\\\\?|\\\\*|' + range + '(?:,' + range + ')*'\n })\n\n var monthValues = 'JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC'\n var monthRange = '(?:' + monthValues + ')(?:(?:-)(?:' + monthValues + '))?'\n regexByField['month'] += '|\\\\?|\\\\*|' + monthRange + '(?:,' + monthRange + ')*'\n\n var dayOfWeekValues = 'MON|TUE|WED|THU|FRI|SAT|SUN'\n var dayOfWeekRange = '(?:' + dayOfWeekValues + ')(?:(?:-)(?:' + dayOfWeekValues + '))?'\n regexByField['dayOfWeek'] += '|\\\\?|\\\\*|' + dayOfWeekRange + '(?:,' + dayOfWeekRange + ')*'\n\n if (!type)\n return (\n '^\\\\s*($' +\n '|#' +\n '|\\\\w+\\\\s*=' +\n '|' +\n '(' +\n regexByField['sec'] +\n ')\\\\s+' +\n '(' +\n regexByField['min'] +\n ')\\\\s+' +\n '(' +\n regexByField['hour'] +\n ')\\\\s+' +\n '(' +\n regexByField['day'] +\n ')\\\\s+' +\n '(' +\n regexByField['month'] +\n ')\\\\s+' +\n '(' +\n regexByField['dayOfWeek'] +\n ')(|\\\\s)+' +\n ')$'\n )\n else return `^${regexByField[type]}$`\n}\n\n@customElement('ox-input-crontab')\nexport class OxInputCrontab extends OxFormField {\n static styles = css`\n :host {\n display: block;\n width: 100%;\n height: 100%;\n border: 0;\n }\n\n :host * {\n box-sizing: border-box;\n }\n :host *:focus {\n outline: none;\n }\n\n form {\n display: grid;\n width: 100%;\n height: 100%;\n padding: 1rem;\n grid-template: auto auto 1fr auto / repeat(6, 1fr);\n grid-gap: 0.5rem;\n justify-content: center;\n align-items: center;\n overflow: auto;\n }\n\n label[for='example'] {\n text-align: right;\n grid-column: 3;\n font: normal 1em var(--theme-font);\n color: var(--secondary-color);\n text-transform: capitalize;\n }\n\n #example {\n grid-column: 4 / span 3;\n width: 100%;\n height: 100%;\n padding: var(--input-padding);\n border: 0;\n border-bottom: var(--border-dark-color);\n text-transform: capitalize;\n font: var(--label-font);\n color: var(--label-color);\n }\n\n input {\n width: 100%;\n margin-top: var(--margin-default);\n padding: 5px;\n border: 0;\n border-bottom: var(--border-dark-color);\n padding: var(--input-padding);\n font: var(--input-font);\n color: var(--primary-text-color);\n }\n input:focus {\n outline: none;\n border-bottom: 1px solid var(--primary-color);\n }\n\n input:invalid {\n border-bottom: 1px solid var(--status-danger-color);\n color: var(--status-danger-color);\n }\n\n label {\n width: 100%;\n font: normal 0.8em var(--theme-font);\n color: var(--primary-color);\n }\n\n label:not([for='example']) {\n text-align: center;\n }\n\n #input-wrapper {\n grid-column: span 6;\n display: flex;\n flex-wrap: wrap;\n margin: 0 -0.25rem;\n }\n\n #input-wrapper > div {\n flex: 1;\n display: grid;\n grid-template-rows: 1fr auto;\n grid-gap: 0.5rem;\n min-width: 60px;\n max-width: 33%;\n margin: 0.25rem;\n }\n\n #tooltip {\n grid-column: span 6;\n display: grid;\n grid-template-columns: auto 1fr;\n grid-gap: 0;\n margin: auto;\n grid-auto-rows: min-content;\n align-self: center;\n align-items: center;\n }\n\n #tooltip > div {\n padding: 0.25rem 0.5rem;\n border-bottom: #ccc 1px dashed;\n font: normal 0.9em var(--theme-font);\n }\n\n #tooltip > .crontab-value {\n text-align: right;\n color: var(--secondary-color);\n }\n\n #tooltip > .crontab-description {\n text-align: left;\n color: #585858;\n }\n\n #button-wrapper {\n grid-column: 1 / span 6;\n display: flex;\n flex-wrap: wrap-reverse;\n flex-direction: row-reverse;\n margin: -0.25rem;\n }\n\n mwc-button {\n background-color: var(--secondary-color);\n border-radius: var(--button-border-radius);\n --mdc-theme-primary: #fff;\n margin: 0.25rem;\n }\n mwc-button:hover,\n mwc-button:active {\n background-color: var(--primary-color);\n }\n `\n\n @property({ type: String }) value?: string\n @property({ type: String }) second?: string\n @property({ type: String }) minute?: string\n @property({ type: String }) hour?: string\n @property({ type: String }) dayOfMonth?: string\n @property({ type: String }) month?: string\n @property({ type: String }) dayOfWeek?: string\n\n @state() tooltip: { value: string; description: string }[] = []\n\n render() {\n return html`\n <form>\n <label for=\"example\">${i18next.t('label.examples')}</label>\n <select\n id=\"example\"\n @change=${(e: Event) => (this.value = (e.currentTarget as HTMLInputElement).value)}\n .value=${this.value || ''}\n >\n <optgroup label=\"String(${i18next.t('label.second by second')})\">\n <option value=\"* * * * * *\">${i18next.t('text.every second')}</option>\n <option value=\"0/2 * * * * *\">${i18next.t('text.every 2 seconds')}</option>\n <option value=\"0/15 * * * * *\">${i18next.t('text.every 15 seconds')}</option>\n <option value=\"0/30 * * * * *\">${i18next.t('text.every 30 seconds')}</option>\n </optgroup>\n <optgroup label=\"String(${i18next.t('label.minute by minute')})\">\n <option value=\"0 * * * * *\">${i18next.t('text.every minute')}</option>\n <option value=\"0 0/2 * * * *\">${i18next.t('text.every 2 minutes')}</option>\n <option value=\"0 0/15 * * * *\">${i18next.t('text.every 15 minutes')}</option>\n <option value=\"0 0/30 * * * *\">${i18next.t('text.every half hour')}</option>\n </optgroup>\n <optgroup label=\"String(${i18next.t('label.hourly')})\">\n <option value=\"0 0 * * * *\">${i18next.t('text.every hour')}</option>\n <option value=\"0 0 0/2 * * *\">${i18next.t('text.every 2 hours')}</option>\n <option value=\"0 0 0/12 * * *\">${i18next.t('text.every 12 hours')}</option>\n <option value=\"0 0 10-19 * * *\">${i18next.t('text.every hour during working time')}</option>\n </optgroup>\n <optgroup label=\"String(${i18next.t('label.daily')})\">\n <option value=\"0 0 0 * * *\">${i18next.t('text.every day')}</option>\n </optgroup>\n <optgroup label=\"String(${i18next.t('label.weekly')})\">\n <option value=\"0 0 0 * * SUN\">${i18next.t('text.every sunday')}</option>\n <option value=\"0 0 0 * * 0\">${i18next.t('text.every sunday')}(2)</option>\n <option value=\"0 0 0 * * 1-5\">${i18next.t('text.every weekday')}</option>\n </optgroup>\n <optgroup label=\"String(${i18next.t('label.monthly')})\">\n <option value=\"0 0 0 1 * *\">${i18next.t('text.the first day of every month')}</option>\n <option value=\"0 0 10 21 * *\">${i18next.t('text.10 am on every payday')}</option>\n </optgroup>\n <optgroup label=\"String(${i18next.t('label.yearly')})\">\n <option value=\"0 0 0 1 1 *\">${i18next.t('text.the first day of every year')}</option>\n <option value=\"0 0 0 25 12 *\">${i18next.t('text.every christmas')}</option>\n </optgroup>\n </select>\n <div id=\"input-wrapper\">\n <div>\n <input\n id=\"second-input\"\n class=\"second\"\n type=\"text\"\n .value=${this.second || ''}\n @input=${(e: Event) => (this.second = (e.currentTarget as HTMLInputElement).value)}\n @focus=${(e: Event) => {\n this.showTooltip('second')\n }}\n pattern=${createCronRegex('sec')}\n required\n />\n <label for=\"second-input\" class=\"second\">${i18next.t('label.second')}</label>\n </div>\n <div>\n <input\n id=\"minute-input\"\n class=\"minute\"\n type=\"text\"\n .value=${this.minute || ''}\n @input=${(e: Event) => (this.minute = (e.currentTarget as HTMLInputElement).value)}\n @focus=${(e: Event) => {\n this.showTooltip('minute')\n }}\n pattern=${createCronRegex('min')}\n required\n />\n <label for=\"minute-input\" class=\"minute\">${i18next.t('label.minute')}</label>\n </div>\n <div>\n <input\n id=\"hour-input\"\n class=\"hour\"\n type=\"text\"\n .value=${this.hour || ''}\n @input=${(e: Event) => (this.hour = (e.currentTarget as HTMLInputElement).value)}\n @focus=${(e: Event) => {\n this.showTooltip('hour')\n }}\n pattern=${createCronRegex('hour')}\n required\n />\n <label for=\"hour-input\" class=\"hour\">${i18next.t('label.hour')}</label>\n </div>\n <div>\n <input\n id=\"day-of-month-input\"\n class=\"day-of-month\"\n type=\"text\"\n .value=${this.dayOfMonth || ''}\n @input=${(e: Event) => (this.dayOfMonth = (e.currentTarget as HTMLInputElement).value)}\n @focus=${(e: Event) => {\n this.showTooltip('dayOfMonth')\n }}\n pattern=${createCronRegex('day')}\n required\n />\n <label for=\"day-of-month-input\" class=\"day-of-month\">${i18next.t('label.day-of-month')}</label>\n </div>\n <div>\n <input\n id=\"month-input\"\n class=\"month\"\n type=\"text\"\n .value=${this.month || ''}\n @input=${(e: Event) => (this.month = (e.currentTarget as HTMLInputElement).value)}\n @focus=${(e: Event) => {\n this.showTooltip('month')\n }}\n pattern=${createCronRegex('month')}\n required\n />\n <label for=\"month-input\" class=\"month\">${i18next.t('label.month')}</label>\n </div>\n <div>\n <input\n id=\"day-of-week-input\"\n class=\"day-of-week\"\n type=\"text\"\n .value=${this.dayOfWeek || ''}\n @input=${(e: Event) => (this.dayOfWeek = (e.currentTarget as HTMLInputElement).value)}\n @focus=${(e: Event) => {\n this.showTooltip('dayOfWeek')\n }}\n pattern=${createCronRegex('dayOfWeek')}\n required\n />\n <label for=\"day-of-week-input\" class=\"day-of-week\">${i18next.t('label.day-of-week')}</label>\n </div>\n </div>\n <div id=\"tooltip\">\n ${this.tooltip.map(\n tip => html`\n <div class=\"crontab-value\">${tip.value}</div>\n <div class=\"crontab-description\">${i18next.t(`text.${tip.description}`)}</div>\n `\n )}\n </div>\n <button\n id=\"clear\"\n @click=${(e: Event) => {\n e.preventDefault()\n e.stopPropagation()\n this.value = ''\n this.dispatchEvent(\n new CustomEvent('change', {\n bubbles: true,\n composed: true,\n detail: this.value\n })\n )\n }}\n >\n Clear\n </button>\n </form>\n `\n }\n\n get focusableElements(): HTMLElement[] {\n return Array.from(this.renderRoot.querySelectorAll('select, input, mwc-button'))\n }\n\n firstUpdated() {\n ;(this.renderRoot.querySelector('input') as HTMLInputElement).focus()\n this.renderRoot.addEventListener('change', this.onChange.bind(this))\n }\n\n updated(changes: PropertyValues<this>) {\n if (changes.has('value')) {\n var values = (this.value || '').split(' ')\n\n if (values.length == 1) values = ['*', '*', '*', '*', '*', '*']\n else if (values.length == 5) values = ['0'].concat(values)\n\n this.second = values[0]\n this.minute = values[1]\n this.hour = values[2]\n this.dayOfMonth = values[3]\n this.month = values[4]\n this.dayOfWeek = values[5]\n }\n }\n\n showTooltip(type: 'second' | 'minute' | 'hour' | 'dayOfMonth' | 'month' | 'dayOfWeek') {\n switch (type) {\n case 'second':\n case 'minute':\n this.tooltip = [\n {\n value: '*',\n description: 'any value'\n },\n {\n value: ',',\n description: 'value list separator'\n },\n {\n value: '-',\n description: 'range of values'\n },\n {\n value: '/',\n description: 'step values'\n },\n {\n value: '0-59',\n description: 'allowed values'\n }\n ]\n break\n case 'hour':\n this.tooltip = [\n {\n value: '*',\n description: 'any value'\n },\n {\n value: ',',\n description: 'value list separator'\n },\n {\n value: '-',\n description: 'range of values'\n },\n {\n value: '/',\n description: 'step values'\n },\n {\n value: '0-23',\n description: 'allowed values'\n }\n ]\n break\n\n case 'dayOfMonth':\n this.tooltip = [\n {\n value: '*',\n description: 'any value'\n },\n {\n value: ',',\n description: 'value list separator'\n },\n {\n value: '-',\n description: 'range of values'\n },\n {\n value: '/',\n description: 'step values'\n },\n {\n value: '1-31',\n description: 'allowed values'\n }\n ]\n break\n\n case 'month':\n this.tooltip = [\n {\n value: '*',\n description: 'any value'\n },\n {\n value: ',',\n description: 'value list separator'\n },\n {\n value: '-',\n description: 'range of values'\n },\n {\n value: '/',\n description: 'step values'\n },\n {\n value: '1-12',\n description: 'allowed values'\n },\n {\n value: 'JAN-DEC',\n description: 'alternative single values'\n }\n ]\n break\n\n case 'dayOfWeek':\n this.tooltip = [\n {\n value: '*',\n description: 'any value'\n },\n {\n value: ',',\n description: 'value list separator'\n },\n {\n value: '-',\n description: 'range of values'\n },\n {\n value: '/',\n description: 'step values'\n },\n {\n value: '0-6',\n description: 'allowed values'\n },\n {\n value: 'SUN-SAT',\n description: 'alternative single values'\n }\n ]\n break\n\n default:\n this.tooltip = []\n break\n }\n }\n\n onChange() {\n var form = this.renderRoot.querySelector('form') as HTMLFormElement\n var valid = form.checkValidity()\n if (!valid) {\n form.reportValidity()\n return\n }\n\n this.value = `${this.second} ${this.minute} ${this.hour} ${this.dayOfMonth} ${this.month} ${this.dayOfWeek}`\n\n this.dispatchEvent(\n new CustomEvent('change', {\n bubbles: true,\n composed: true,\n detail: this.value\n })\n )\n }\n}\n"]}
|
1
|
+
{"version":3,"file":"ox-input-crontab.js","sourceRoot":"","sources":["../../src/ox-input-crontab.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,EAAE,GAAG,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAEvC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAE7C,SAAS,eAAe,CAAC,IAA4D;IACnF,yDAAyD;IACzD,IAAI,YAAY,GAAG,EAAS,CAAA;IAC5B,YAAY,CAAC,KAAK,CAAC,GAAG,WAAW,CAAA;IACjC,YAAY,CAAC,KAAK,CAAC,GAAG,WAAW,CAAA;IACjC,YAAY,CAAC,MAAM,CAAC,GAAG,iBAAiB,CAAA;IACxC,YAAY,CAAC,KAAK,CAAC,GAAG,uBAAuB,CAAA;IAC7C,YAAY,CAAC,OAAO,CAAC,GAAG,cAAc,CAAA;IACtC,YAAY,CAAC,WAAW,CAAC,GAAG,OAAO,CAAA;IAEnC,IAAI,aAAa,GAAG,CAAC,IAAI,CAAC,CAAA;IAC1B,IAAI,CAAC,IAAI;QAAE,aAAa,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,CAAC,CAAA;IAE9E,aAAa,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QAC5B,IAAI,MAAM,GAAG,YAAY,CAAC,KAAK,CAAC,CAAA;QAChC,IAAI,KAAK,GAC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,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAAgB;AACf;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAc;AACb;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDAAoB;AACnB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAAe;AACd;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iDAAmB;AAErC;IAAR,KAAK,EAAE;+CAAuD;AApJpD,cAAc;IAD1B,aAAa,CAAC,kBAAkB,CAAC;GACrB,cAAc,CAmf1B","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport { css, html, PropertyValues } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { i18next } from '@operato/i18n'\n\nimport { OxFormField } from './ox-form-field'\n\nfunction createCronRegex(type: 'sec' | 'min' | 'hour' | 'day' | 'month' | 'dayOfWeek') {\n // https://gist.github.com/dkandalov/a2aed17cfdeb65243022\n var regexByField = {} as any\n regexByField['sec'] = '[0-5]?\\\\d'\n regexByField['min'] = '[0-5]?\\\\d'\n regexByField['hour'] = '[01]?\\\\d|2[0-3]'\n regexByField['day'] = '0?[1-9]|[12]\\\\d|3[01]'\n regexByField['month'] = '[1-9]|1[012]'\n regexByField['dayOfWeek'] = '[0-7]'\n\n var crontabFields = [type]\n if (!type) crontabFields = ['sec', 'min', 'hour', 'day', 'month', 'dayOfWeek']\n\n crontabFields.forEach(field => {\n var number = regexByField[field]\n var range =\n '(?:' +\n number +\n ')' +\n '(?:' +\n '(?:-|/|,' +\n ('dayOfWeek' === field ? '|#' : '') +\n ')' +\n '(?:' +\n number +\n ')' +\n ')?'\n if (field === 'dayOfWeek') range += '(?:L)?'\n if (field === 'month') range += '(?:L|W)?'\n regexByField[field] = '\\\\?|\\\\*|' + range + '(?:,' + range + ')*'\n })\n\n var monthValues = 'JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC'\n var monthRange = '(?:' + monthValues + ')(?:(?:-)(?:' + monthValues + '))?'\n regexByField['month'] += '|\\\\?|\\\\*|' + monthRange + '(?:,' + monthRange + ')*'\n\n var dayOfWeekValues = 'MON|TUE|WED|THU|FRI|SAT|SUN'\n var dayOfWeekRange = '(?:' + dayOfWeekValues + ')(?:(?:-)(?:' + dayOfWeekValues + '))?'\n regexByField['dayOfWeek'] += '|\\\\?|\\\\*|' + dayOfWeekRange + '(?:,' + dayOfWeekRange + ')*'\n\n if (!type)\n return (\n '^\\\\s*($' +\n '|#' +\n '|\\\\w+\\\\s*=' +\n '|' +\n '(' +\n regexByField['sec'] +\n ')\\\\s+' +\n '(' +\n regexByField['min'] +\n ')\\\\s+' +\n '(' +\n regexByField['hour'] +\n ')\\\\s+' +\n '(' +\n regexByField['day'] +\n ')\\\\s+' +\n '(' +\n regexByField['month'] +\n ')\\\\s+' +\n '(' +\n regexByField['dayOfWeek'] +\n ')(|\\\\s)+' +\n ')$'\n )\n else return `^${regexByField[type]}$`\n}\n\n@customElement('ox-input-crontab')\nexport class OxInputCrontab extends OxFormField {\n static styles = css`\n :host {\n display: block;\n width: 100%;\n height: 100%;\n border: 0;\n }\n\n :host * {\n box-sizing: border-box;\n }\n :host *:focus {\n outline: none;\n }\n\n form {\n display: grid;\n width: 100%;\n height: 100%;\n padding: 1rem;\n grid-template: auto auto 1fr auto / repeat(6, 1fr);\n grid-gap: 0.5rem;\n justify-content: center;\n align-items: center;\n overflow: auto;\n }\n\n label[for='example'] {\n text-align: right;\n grid-column: 3;\n font: normal 1em var(--theme-font);\n color: var(--secondary-color);\n text-transform: capitalize;\n }\n\n #example {\n grid-column: 4 / span 3;\n width: 100%;\n height: 100%;\n padding: var(--input-padding);\n border: 0;\n border-bottom: var(--border-dark-color);\n text-transform: capitalize;\n font: var(--label-font);\n color: var(--label-color);\n }\n\n input {\n width: 100%;\n margin-top: var(--margin-default);\n padding: 5px;\n border: 0;\n border-bottom: var(--border-dark-color);\n padding: var(--input-padding);\n font: var(--input-font);\n color: var(--primary-text-color);\n }\n input:focus {\n outline: none;\n border-bottom: 1px solid var(--primary-color);\n }\n\n input:invalid {\n border-bottom: 1px solid var(--status-danger-color);\n color: var(--status-danger-color);\n }\n\n label {\n width: 100%;\n font: normal 0.8em var(--theme-font);\n color: var(--primary-color);\n }\n\n label:not([for='example']) {\n text-align: center;\n }\n\n #input-wrapper {\n grid-column: span 6;\n display: flex;\n flex-wrap: wrap;\n margin: 0 -0.25rem;\n }\n\n #input-wrapper > div {\n flex: 1;\n display: grid;\n grid-template-rows: 1fr auto;\n grid-gap: 0.5rem;\n min-width: 60px;\n max-width: 33%;\n margin: 0.25rem;\n }\n\n #tooltip {\n grid-column: span 6;\n display: grid;\n grid-template-columns: auto 1fr;\n grid-gap: 0;\n margin: auto;\n grid-auto-rows: min-content;\n align-self: center;\n align-items: center;\n }\n\n #tooltip > div {\n padding: 0.25rem 0.5rem;\n border-bottom: #ccc 1px dashed;\n font: normal 0.9em var(--theme-font);\n }\n\n #tooltip > .crontab-value {\n text-align: right;\n color: var(--secondary-color);\n }\n\n #tooltip > .crontab-description {\n text-align: left;\n color: #585858;\n }\n\n #button-wrapper {\n grid-column: 1 / span 6;\n display: flex;\n flex-wrap: wrap-reverse;\n flex-direction: row-reverse;\n margin: -0.25rem;\n }\n\n button {\n border-radius: var(--button-border-radius);\n margin: 0.25rem;\n }\n button:hover,\n button:active {\n background-color: var(--primary-color);\n }\n `\n\n @property({ type: String }) value?: string\n @property({ type: String }) second?: string\n @property({ type: String }) minute?: string\n @property({ type: String }) hour?: string\n @property({ type: String }) dayOfMonth?: string\n @property({ type: String }) month?: string\n @property({ type: String }) dayOfWeek?: string\n\n @state() tooltip: { value: string; description: string }[] = []\n\n render() {\n return html`\n <form>\n <label for=\"example\">${i18next.t('label.examples')}</label>\n <select\n id=\"example\"\n @change=${(e: Event) => (this.value = (e.currentTarget as HTMLInputElement).value)}\n .value=${this.value || ''}\n >\n <optgroup label=\"String(${i18next.t('label.second by second')})\">\n <option value=\"* * * * * *\">${i18next.t('text.every second')}</option>\n <option value=\"0/2 * * * * *\">${i18next.t('text.every 2 seconds')}</option>\n <option value=\"0/15 * * * * *\">${i18next.t('text.every 15 seconds')}</option>\n <option value=\"0/30 * * * * *\">${i18next.t('text.every 30 seconds')}</option>\n </optgroup>\n <optgroup label=\"String(${i18next.t('label.minute by minute')})\">\n <option value=\"0 * * * * *\">${i18next.t('text.every minute')}</option>\n <option value=\"0 0/2 * * * *\">${i18next.t('text.every 2 minutes')}</option>\n <option value=\"0 0/15 * * * *\">${i18next.t('text.every 15 minutes')}</option>\n <option value=\"0 0/30 * * * *\">${i18next.t('text.every half hour')}</option>\n </optgroup>\n <optgroup label=\"String(${i18next.t('label.hourly')})\">\n <option value=\"0 0 * * * *\">${i18next.t('text.every hour')}</option>\n <option value=\"0 0 0/2 * * *\">${i18next.t('text.every 2 hours')}</option>\n <option value=\"0 0 0/12 * * *\">${i18next.t('text.every 12 hours')}</option>\n <option value=\"0 0 10-19 * * *\">${i18next.t('text.every hour during working time')}</option>\n </optgroup>\n <optgroup label=\"String(${i18next.t('label.daily')})\">\n <option value=\"0 0 0 * * *\">${i18next.t('text.every day')}</option>\n </optgroup>\n <optgroup label=\"String(${i18next.t('label.weekly')})\">\n <option value=\"0 0 0 * * SUN\">${i18next.t('text.every sunday')}</option>\n <option value=\"0 0 0 * * 0\">${i18next.t('text.every sunday')}(2)</option>\n <option value=\"0 0 0 * * 1-5\">${i18next.t('text.every weekday')}</option>\n </optgroup>\n <optgroup label=\"String(${i18next.t('label.monthly')})\">\n <option value=\"0 0 0 1 * *\">${i18next.t('text.the first day of every month')}</option>\n <option value=\"0 0 10 21 * *\">${i18next.t('text.10 am on every payday')}</option>\n </optgroup>\n <optgroup label=\"String(${i18next.t('label.yearly')})\">\n <option value=\"0 0 0 1 1 *\">${i18next.t('text.the first day of every year')}</option>\n <option value=\"0 0 0 25 12 *\">${i18next.t('text.every christmas')}</option>\n </optgroup>\n </select>\n <div id=\"input-wrapper\">\n <div>\n <input\n id=\"second-input\"\n class=\"second\"\n type=\"text\"\n .value=${this.second || ''}\n @input=${(e: Event) => (this.second = (e.currentTarget as HTMLInputElement).value)}\n @focus=${(e: Event) => {\n this.showTooltip('second')\n }}\n pattern=${createCronRegex('sec')}\n required\n />\n <label for=\"second-input\" class=\"second\">${i18next.t('label.second')}</label>\n </div>\n <div>\n <input\n id=\"minute-input\"\n class=\"minute\"\n type=\"text\"\n .value=${this.minute || ''}\n @input=${(e: Event) => (this.minute = (e.currentTarget as HTMLInputElement).value)}\n @focus=${(e: Event) => {\n this.showTooltip('minute')\n }}\n pattern=${createCronRegex('min')}\n required\n />\n <label for=\"minute-input\" class=\"minute\">${i18next.t('label.minute')}</label>\n </div>\n <div>\n <input\n id=\"hour-input\"\n class=\"hour\"\n type=\"text\"\n .value=${this.hour || ''}\n @input=${(e: Event) => (this.hour = (e.currentTarget as HTMLInputElement).value)}\n @focus=${(e: Event) => {\n this.showTooltip('hour')\n }}\n pattern=${createCronRegex('hour')}\n required\n />\n <label for=\"hour-input\" class=\"hour\">${i18next.t('label.hour')}</label>\n </div>\n <div>\n <input\n id=\"day-of-month-input\"\n class=\"day-of-month\"\n type=\"text\"\n .value=${this.dayOfMonth || ''}\n @input=${(e: Event) => (this.dayOfMonth = (e.currentTarget as HTMLInputElement).value)}\n @focus=${(e: Event) => {\n this.showTooltip('dayOfMonth')\n }}\n pattern=${createCronRegex('day')}\n required\n />\n <label for=\"day-of-month-input\" class=\"day-of-month\">${i18next.t('label.day-of-month')}</label>\n </div>\n <div>\n <input\n id=\"month-input\"\n class=\"month\"\n type=\"text\"\n .value=${this.month || ''}\n @input=${(e: Event) => (this.month = (e.currentTarget as HTMLInputElement).value)}\n @focus=${(e: Event) => {\n this.showTooltip('month')\n }}\n pattern=${createCronRegex('month')}\n required\n />\n <label for=\"month-input\" class=\"month\">${i18next.t('label.month')}</label>\n </div>\n <div>\n <input\n id=\"day-of-week-input\"\n class=\"day-of-week\"\n type=\"text\"\n .value=${this.dayOfWeek || ''}\n @input=${(e: Event) => (this.dayOfWeek = (e.currentTarget as HTMLInputElement).value)}\n @focus=${(e: Event) => {\n this.showTooltip('dayOfWeek')\n }}\n pattern=${createCronRegex('dayOfWeek')}\n required\n />\n <label for=\"day-of-week-input\" class=\"day-of-week\">${i18next.t('label.day-of-week')}</label>\n </div>\n </div>\n <div id=\"tooltip\">\n ${this.tooltip.map(\n tip => html`\n <div class=\"crontab-value\">${tip.value}</div>\n <div class=\"crontab-description\">${i18next.t(`text.${tip.description}`)}</div>\n `\n )}\n </div>\n <button\n id=\"clear\"\n @click=${(e: Event) => {\n e.preventDefault()\n e.stopPropagation()\n this.value = ''\n this.dispatchEvent(\n new CustomEvent('change', {\n bubbles: true,\n composed: true,\n detail: this.value\n })\n )\n }}\n >\n Clear\n </button>\n </form>\n `\n }\n\n get focusableElements(): HTMLElement[] {\n return Array.from(this.renderRoot.querySelectorAll('select, input, button'))\n }\n\n firstUpdated() {\n ;(this.renderRoot.querySelector('input') as HTMLInputElement).focus()\n this.renderRoot.addEventListener('change', this.onChange.bind(this))\n }\n\n updated(changes: PropertyValues<this>) {\n if (changes.has('value')) {\n var values = (this.value || '').split(' ')\n\n if (values.length == 1) values = ['*', '*', '*', '*', '*', '*']\n else if (values.length == 5) values = ['0'].concat(values)\n\n this.second = values[0]\n this.minute = values[1]\n this.hour = values[2]\n this.dayOfMonth = values[3]\n this.month = values[4]\n this.dayOfWeek = values[5]\n }\n }\n\n showTooltip(type: 'second' | 'minute' | 'hour' | 'dayOfMonth' | 'month' | 'dayOfWeek') {\n switch (type) {\n case 'second':\n case 'minute':\n this.tooltip = [\n {\n value: '*',\n description: 'any value'\n },\n {\n value: ',',\n description: 'value list separator'\n },\n {\n value: '-',\n description: 'range of values'\n },\n {\n value: '/',\n description: 'step values'\n },\n {\n value: '0-59',\n description: 'allowed values'\n }\n ]\n break\n case 'hour':\n this.tooltip = [\n {\n value: '*',\n description: 'any value'\n },\n {\n value: ',',\n description: 'value list separator'\n },\n {\n value: '-',\n description: 'range of values'\n },\n {\n value: '/',\n description: 'step values'\n },\n {\n value: '0-23',\n description: 'allowed values'\n }\n ]\n break\n\n case 'dayOfMonth':\n this.tooltip = [\n {\n value: '*',\n description: 'any value'\n },\n {\n value: ',',\n description: 'value list separator'\n },\n {\n value: '-',\n description: 'range of values'\n },\n {\n value: '/',\n description: 'step values'\n },\n {\n value: '1-31',\n description: 'allowed values'\n }\n ]\n break\n\n case 'month':\n this.tooltip = [\n {\n value: '*',\n description: 'any value'\n },\n {\n value: ',',\n description: 'value list separator'\n },\n {\n value: '-',\n description: 'range of values'\n },\n {\n value: '/',\n description: 'step values'\n },\n {\n value: '1-12',\n description: 'allowed values'\n },\n {\n value: 'JAN-DEC',\n description: 'alternative single values'\n }\n ]\n break\n\n case 'dayOfWeek':\n this.tooltip = [\n {\n value: '*',\n description: 'any value'\n },\n {\n value: ',',\n description: 'value list separator'\n },\n {\n value: '-',\n description: 'range of values'\n },\n {\n value: '/',\n description: 'step values'\n },\n {\n value: '0-6',\n description: 'allowed values'\n },\n {\n value: 'SUN-SAT',\n description: 'alternative single values'\n }\n ]\n break\n\n default:\n this.tooltip = []\n break\n }\n }\n\n onChange() {\n var form = this.renderRoot.querySelector('form') as HTMLFormElement\n var valid = form.checkValidity()\n if (!valid) {\n form.reportValidity()\n return\n }\n\n this.value = `${this.second} ${this.minute} ${this.hour} ${this.dayOfMonth} ${this.month} ${this.dayOfWeek}`\n\n this.dispatchEvent(\n new CustomEvent('change', {\n bubbles: true,\n composed: true,\n detail: this.value\n })\n )\n }\n}\n"]}
|
@@ -2,7 +2,6 @@
|
|
2
2
|
* @license Copyright © HatioLab Inc. All rights reserved.
|
3
3
|
*/
|
4
4
|
import './ox-input-code';
|
5
|
-
import { PropertyValues } from 'lit';
|
6
5
|
import { OxFormField } from './ox-form-field.js';
|
7
6
|
/**
|
8
7
|
WEB Component for code-mirror based data editor.
|
@@ -14,11 +13,11 @@ Example:
|
|
14
13
|
*/
|
15
14
|
export declare class OxInputData extends OxFormField {
|
16
15
|
static styles: import("lit").CSSResult[];
|
17
|
-
render(): import("lit").TemplateResult<1>;
|
16
|
+
render(): import("lit-html").TemplateResult<1>;
|
18
17
|
firstUpdated(): void;
|
19
|
-
|
18
|
+
_setDataTypeAndValue(type: string | undefined | null, value: any): void;
|
20
19
|
_setDataType(type: string | undefined | null): void;
|
21
20
|
_clearData(): void;
|
22
|
-
|
23
|
-
_onAfterValueChange(): void
|
21
|
+
_getStringData(data: any): string;
|
22
|
+
_onAfterValueChange(): Promise<void>;
|
24
23
|
}
|
@@ -5,7 +5,9 @@ import { __decorate } from "tslib";
|
|
5
5
|
import './ox-input-code';
|
6
6
|
import { css, html } from 'lit';
|
7
7
|
import { customElement } from 'lit/decorators.js';
|
8
|
+
import { live } from 'lit/directives/live.js';
|
8
9
|
import { OxFormField } from './ox-form-field.js';
|
10
|
+
import { isEqual } from 'lodash-es';
|
9
11
|
/**
|
10
12
|
WEB Component for code-mirror based data editor.
|
11
13
|
|
@@ -31,7 +33,7 @@ let OxInputData = class OxInputData extends OxFormField {
|
|
31
33
|
font-size: small;
|
32
34
|
}
|
33
35
|
|
34
|
-
div[datatype]
|
36
|
+
div[datatype] md-icon {
|
35
37
|
margin-left: auto;
|
36
38
|
}
|
37
39
|
|
@@ -43,38 +45,55 @@ let OxInputData = class OxInputData extends OxFormField {
|
|
43
45
|
`
|
44
46
|
]; }
|
45
47
|
render() {
|
48
|
+
const valueType = typeof this.value;
|
46
49
|
return html `
|
47
50
|
<div datatype>
|
48
51
|
<input
|
52
|
+
id="string"
|
49
53
|
type="radio"
|
50
54
|
name="data-type"
|
51
55
|
data-value="string"
|
52
|
-
.checked=${
|
56
|
+
.checked=${live(valueType == 'string')}
|
53
57
|
@click=${() => this._setDataType('string')}
|
54
58
|
?disabled=${this.disabled}
|
55
|
-
/>
|
59
|
+
/>
|
60
|
+
<label for="string">string</label>
|
56
61
|
|
57
62
|
<input
|
63
|
+
id="number"
|
58
64
|
type="radio"
|
59
65
|
name="data-type"
|
60
66
|
data-value="number"
|
61
|
-
.checked=${
|
67
|
+
.checked=${live(valueType == 'number')}
|
62
68
|
@click=${() => this._setDataType('number')}
|
63
69
|
?disabled=${this.disabled}
|
64
|
-
/>
|
70
|
+
/>
|
71
|
+
<label for="number">number</label>
|
65
72
|
|
66
73
|
<input
|
74
|
+
id="object"
|
67
75
|
type="radio"
|
68
76
|
name="data-type"
|
69
77
|
data-value="object"
|
70
|
-
.checked=${
|
78
|
+
.checked=${live(valueType == 'object')}
|
71
79
|
@click=${() => this._setDataType('object')}
|
72
80
|
?disabled=${this.disabled}
|
73
|
-
/>
|
74
|
-
<
|
81
|
+
/>
|
82
|
+
<label for="object">object</label>
|
83
|
+
|
84
|
+
<md-icon @click=${() => this._clearData()} title="delete">delete_forever</md-icon>
|
75
85
|
</div>
|
76
86
|
|
77
|
-
<ox-input-code
|
87
|
+
<ox-input-code
|
88
|
+
.value=${this._getStringData(this.value)}
|
89
|
+
language="text"
|
90
|
+
editor
|
91
|
+
?disabled=${this.disabled}
|
92
|
+
@change=${(e) => {
|
93
|
+
e.stopPropagation();
|
94
|
+
this._setDataTypeAndValue(valueType, e.target.value);
|
95
|
+
}}
|
96
|
+
>
|
78
97
|
</ox-input-code>
|
79
98
|
`;
|
80
99
|
}
|
@@ -83,49 +102,82 @@ let OxInputData = class OxInputData extends OxFormField {
|
|
83
102
|
e.stopPropagation();
|
84
103
|
const target = e.target;
|
85
104
|
if (target.hasAttribute('editor')) {
|
105
|
+
if (this.value === undefined && target.value == '') {
|
106
|
+
return;
|
107
|
+
}
|
86
108
|
this.value = target.value;
|
87
109
|
}
|
88
|
-
const type = this.renderRoot.querySelector('input[name=data-type]:checked')?.getAttribute('data-value');
|
89
|
-
this._setDataType(type);
|
90
110
|
});
|
91
111
|
}
|
92
|
-
|
93
|
-
|
94
|
-
|
112
|
+
_setDataTypeAndValue(type, value) {
|
113
|
+
/* value must be a string */
|
114
|
+
try {
|
115
|
+
switch (type) {
|
116
|
+
case 'number':
|
117
|
+
if (!isNaN(Number(value))) {
|
118
|
+
value = Number(value);
|
119
|
+
}
|
120
|
+
break;
|
121
|
+
case 'object':
|
122
|
+
value = eval('(' + value + ')');
|
123
|
+
break;
|
124
|
+
}
|
125
|
+
}
|
126
|
+
catch (e) { }
|
127
|
+
if (isEqual(this.value, value)) {
|
128
|
+
return;
|
95
129
|
}
|
130
|
+
this.value = value;
|
131
|
+
this.requestUpdate();
|
132
|
+
this._onAfterValueChange();
|
96
133
|
}
|
97
134
|
_setDataType(type) {
|
98
|
-
if (typeof this.value
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
catch (e) {
|
116
|
-
console.log(e);
|
135
|
+
if (typeof this.value == type) {
|
136
|
+
return;
|
137
|
+
}
|
138
|
+
var value = this.value;
|
139
|
+
try {
|
140
|
+
switch (type) {
|
141
|
+
case 'string':
|
142
|
+
value = this._getStringData(value);
|
143
|
+
break;
|
144
|
+
case 'number':
|
145
|
+
if (!isNaN(value)) {
|
146
|
+
value = Number(value);
|
147
|
+
}
|
148
|
+
break;
|
149
|
+
case 'object':
|
150
|
+
value = eval('(' + value + ')');
|
151
|
+
break;
|
117
152
|
}
|
118
153
|
}
|
154
|
+
catch (e) {
|
155
|
+
console.log(e);
|
156
|
+
}
|
157
|
+
if (isEqual(this.value, value)) {
|
158
|
+
this.requestUpdate();
|
159
|
+
return;
|
160
|
+
}
|
161
|
+
this.value = value;
|
162
|
+
this.requestUpdate();
|
119
163
|
this._onAfterValueChange();
|
120
164
|
}
|
121
165
|
_clearData() {
|
122
166
|
this.value = undefined;
|
123
167
|
this._onAfterValueChange();
|
124
168
|
}
|
125
|
-
|
126
|
-
|
169
|
+
_getStringData(data) {
|
170
|
+
const type = typeof data;
|
171
|
+
switch (type) {
|
172
|
+
case 'object':
|
173
|
+
return JSON.stringify(data, null, 1);
|
174
|
+
case 'undefined':
|
175
|
+
return '';
|
176
|
+
default:
|
177
|
+
return String(data) || '';
|
178
|
+
}
|
127
179
|
}
|
128
|
-
_onAfterValueChange() {
|
180
|
+
async _onAfterValueChange() {
|
129
181
|
this.dispatchEvent(new CustomEvent('change', {
|
130
182
|
bubbles: true,
|
131
183
|
composed: true
|