@operato/input 1.0.0-beta.7 → 1.0.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/.storybook/main.js +2 -2
- package/.storybook/server.mjs +4 -4
- package/CHANGELOG.md +417 -0
- package/demo/index-multiple-colors.html +4 -1
- package/demo/index-partition-keys.html +2 -5
- package/demo/index-select.html +1 -1
- package/demo/index.html +4 -0
- package/dist/src/index.d.ts +4 -2
- package/dist/src/index.js +4 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/locales/en.d.ts +8 -0
- package/dist/src/locales/en.js +8 -0
- package/dist/src/locales/en.js.map +1 -1
- package/dist/src/locales/ko.d.ts +8 -0
- package/dist/src/locales/ko.js +8 -0
- package/dist/src/locales/ko.js.map +1 -1
- package/dist/src/locales/ms.d.ts +8 -0
- package/dist/src/locales/ms.js +8 -0
- package/dist/src/locales/ms.js.map +1 -1
- package/dist/src/locales/zh.d.ts +8 -0
- package/dist/src/locales/zh.js +8 -0
- package/dist/src/locales/zh.js.map +1 -1
- package/dist/src/ox-input-3dish.js +24 -8
- package/dist/src/ox-input-3dish.js.map +1 -1
- package/dist/src/ox-input-barcode.d.ts +5 -2
- package/dist/src/ox-input-barcode.js +61 -31
- package/dist/src/ox-input-barcode.js.map +1 -1
- package/dist/src/ox-input-color.js +16 -11
- package/dist/src/ox-input-color.js.map +1 -1
- package/dist/src/ox-input-crontab.js +28 -10
- package/dist/src/ox-input-crontab.js.map +1 -1
- package/dist/src/ox-input-data.js +1 -1
- package/dist/src/ox-input-data.js.map +1 -1
- package/dist/src/ox-input-duration.d.ts +13 -0
- package/dist/src/ox-input-duration.js +163 -0
- package/dist/src/ox-input-duration.js.map +1 -0
- package/dist/src/ox-input-file.js +5 -3
- package/dist/src/ox-input-file.js.map +1 -1
- package/dist/src/ox-input-key-values.d.ts +41 -0
- package/dist/src/ox-input-key-values.js +233 -0
- package/dist/src/ox-input-key-values.js.map +1 -0
- package/dist/src/ox-input-multiple-colors.d.ts +1 -0
- package/dist/src/ox-input-multiple-colors.js +29 -21
- package/dist/src/ox-input-multiple-colors.js.map +1 -1
- package/dist/src/ox-input-options.d.ts +1 -0
- package/dist/src/ox-input-options.js +55 -14
- package/dist/src/ox-input-options.js.map +1 -1
- package/dist/src/ox-input-partition-keys.d.ts +1 -0
- package/dist/src/ox-input-partition-keys.js +51 -23
- package/dist/src/ox-input-partition-keys.js.map +1 -1
- package/dist/src/ox-input-quantifier.d.ts +11 -0
- package/dist/src/ox-input-quantifier.js +67 -0
- package/dist/src/ox-input-quantifier.js.map +1 -0
- package/dist/src/ox-input-range.js +35 -38
- package/dist/src/ox-input-range.js.map +1 -1
- package/dist/src/ox-input-search.d.ts +1 -0
- package/dist/src/ox-input-search.js +27 -5
- package/dist/src/ox-input-search.js.map +1 -1
- package/dist/src/ox-input-unit.d.ts +17 -0
- package/dist/src/ox-input-unit.js +122 -0
- package/dist/src/ox-input-unit.js.map +1 -0
- package/dist/src/ox-input-value-map.d.ts +2 -2
- package/dist/src/ox-input-value-map.js +51 -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 +50 -23
- package/dist/src/ox-input-value-ranges.js.map +1 -1
- package/dist/src/ox-input-work-shift.js +79 -44
- package/dist/src/ox-input-work-shift.js.map +1 -1
- package/dist/src/ox-select.js +12 -3
- package/dist/src/ox-select.js.map +1 -1
- package/dist/stories/ox-checkbox.stories.d.ts +39 -0
- package/dist/stories/ox-checkbox.stories.js +44 -0
- package/dist/stories/ox-checkbox.stories.js.map +1 -0
- package/dist/stories/ox-input-3dish.stories.d.ts +26 -0
- package/dist/stories/ox-input-3dish.stories.js +59 -0
- package/dist/stories/ox-input-3dish.stories.js.map +1 -0
- package/dist/stories/ox-input-barcode.stories.d.ts +43 -0
- package/dist/stories/ox-input-barcode.stories.js +59 -0
- package/dist/stories/ox-input-barcode.stories.js.map +1 -0
- package/dist/stories/ox-input-crontab.stories.d.ts +25 -0
- package/dist/stories/ox-input-crontab.stories.js +35 -0
- package/dist/stories/ox-input-crontab.stories.js.map +1 -0
- package/dist/stories/ox-input-duration.stories.d.ts +26 -0
- package/dist/stories/ox-input-duration.stories.js +37 -0
- package/dist/stories/ox-input-duration.stories.js.map +1 -0
- package/dist/stories/ox-input-file.stories.d.ts +49 -0
- package/dist/stories/ox-input-file.stories.js +48 -0
- package/dist/stories/ox-input-file.stories.js.map +1 -0
- package/dist/stories/{index.stories.d.ts → ox-input-key-values.stories.d.ts} +7 -11
- package/dist/stories/ox-input-key-values.stories.js +49 -0
- package/dist/stories/ox-input-key-values.stories.js.map +1 -0
- package/dist/stories/ox-input-multiple-colors.stories.d.ts +20 -0
- package/dist/stories/ox-input-multiple-colors.stories.js +167 -0
- package/dist/stories/ox-input-multiple-colors.stories.js.map +1 -0
- package/dist/stories/ox-input-options.stories.d.ts +25 -0
- package/dist/stories/ox-input-options.stories.js +33 -0
- package/dist/stories/ox-input-options.stories.js.map +1 -0
- package/dist/stories/ox-input-partition-keys.stories.d.ts +25 -0
- package/dist/stories/ox-input-partition-keys.stories.js +37 -0
- package/dist/stories/ox-input-partition-keys.stories.js.map +1 -0
- package/dist/stories/ox-input-quantifier.stories.d.ts +25 -0
- package/dist/stories/ox-input-quantifier.stories.js +27 -0
- package/dist/stories/ox-input-quantifier.stories.js.map +1 -0
- package/dist/stories/ox-input-range.stories.d.ts +37 -0
- package/dist/stories/ox-input-range.stories.js +28 -0
- package/dist/stories/ox-input-range.stories.js.map +1 -0
- package/dist/stories/ox-input-search.stories.d.ts +33 -0
- package/dist/stories/ox-input-search.stories.js +35 -0
- package/dist/stories/ox-input-search.stories.js.map +1 -0
- package/dist/stories/ox-input-unit.stories.d.ts +40 -0
- package/dist/stories/ox-input-unit.stories.js +42 -0
- package/dist/stories/ox-input-unit.stories.js.map +1 -0
- package/dist/stories/ox-input-value-map.stories.d.ts +35 -0
- package/dist/stories/ox-input-value-map.stories.js +37 -0
- package/dist/stories/ox-input-value-map.stories.js.map +1 -0
- package/dist/stories/ox-input-value-ranges.stories.d.ts +35 -0
- package/dist/stories/ox-input-value-ranges.stories.js +37 -0
- package/dist/stories/ox-input-value-ranges.stories.js.map +1 -0
- package/dist/stories/ox-input-work-shift.stories.d.ts +26 -0
- package/dist/stories/ox-input-work-shift.stories.js +59 -0
- package/dist/stories/ox-input-work-shift.stories.js.map +1 -0
- package/dist/stories/ox-select.stories.d.ts +30 -0
- package/dist/stories/ox-select.stories.js +83 -0
- package/dist/stories/ox-select.stories.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +16 -13
- package/src/index.ts +4 -2
- package/src/locales/en.ts +8 -0
- package/src/locales/ko.ts +8 -0
- package/src/locales/ms.ts +8 -0
- package/src/locales/zh.ts +8 -0
- package/src/ox-input-3dish.ts +24 -8
- package/src/ox-input-barcode.ts +67 -34
- package/src/ox-input-color.ts +17 -11
- package/src/ox-input-crontab.ts +30 -10
- package/src/ox-input-data.ts +2 -2
- package/src/ox-input-duration.ts +168 -0
- package/src/ox-input-file.ts +7 -6
- package/src/ox-input-key-values.ts +270 -0
- package/src/ox-input-multiple-colors.ts +29 -21
- package/src/ox-input-options.ts +54 -13
- package/src/ox-input-partition-keys.ts +51 -22
- package/src/ox-input-quantifier.ts +62 -0
- package/src/ox-input-range.ts +35 -38
- package/src/ox-input-search.ts +29 -5
- package/src/ox-input-unit.ts +123 -0
- package/src/ox-input-value-map.ts +52 -16
- package/src/ox-input-value-ranges.ts +52 -25
- package/src/ox-input-work-shift.ts +81 -44
- package/src/ox-select.ts +19 -5
- package/stories/ox-checkbox.stories.ts +69 -0
- package/stories/ox-input-3dish.stories.ts +73 -0
- package/stories/ox-input-barcode.stories.ts +85 -0
- package/stories/ox-input-code.stories.ts_ +51 -0
- package/stories/ox-input-crontab.stories.ts +49 -0
- package/stories/ox-input-duration.stories.ts +51 -0
- package/stories/ox-input-file.stories.ts +77 -0
- package/stories/ox-input-key-values.stories.ts +64 -0
- package/stories/ox-input-multiple-colors.stories.ts +178 -0
- package/stories/ox-input-options.stories.ts +47 -0
- package/stories/ox-input-partition-keys.stories.ts +51 -0
- package/stories/ox-input-quantifier.stories.ts +43 -0
- package/stories/ox-input-range.stories.ts +45 -0
- package/stories/ox-input-search.stories.ts +56 -0
- package/stories/ox-input-unit.stories.ts +66 -0
- package/stories/ox-input-value-map.stories.ts +58 -0
- package/stories/ox-input-value-ranges.stories.ts +58 -0
- package/stories/ox-input-work-shift.stories.ts +73 -0
- package/stories/ox-select.stories.ts +101 -0
- package/themes/app-theme.css +142 -0
- package/themes/input-theme.css +19 -0
- package/translations/en.json +45 -1
- package/translations/ko.json +43 -1
- package/translations/ms.json +43 -1
- package/translations/zh.json +43 -1
- package/xliff/en.xlf +24 -0
- package/xliff/ko.xlf +32 -0
- package/xliff/ms.xlf +24 -0
- package/xliff/zh.xlf +24 -0
- package/dist/stories/index.stories.js +0 -33
- package/dist/stories/index.stories.js.map +0 -1
- package/stories/index.stories.ts +0 -52
package/package.json
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
"description": "Webcomponent property-editor following open-wc recommendations",
|
4
4
|
"license": "MIT",
|
5
5
|
"author": "heartyoh@hatiolab.com",
|
6
|
-
"version": "1.0.0
|
6
|
+
"version": "1.0.0",
|
7
7
|
"main": "dist/src/index.js",
|
8
8
|
"module": "dist/src/index.js",
|
9
9
|
"publishConfig": {
|
@@ -30,8 +30,11 @@
|
|
30
30
|
"./ox-input-color-gradient.js": "./dist/src/ox-input-color-gradient.js",
|
31
31
|
"./ox-input-crontab.js": "./dist/src/ox-input-crontab.js",
|
32
32
|
"./ox-input-data.js": "./dist/src/ox-input-data.js",
|
33
|
+
"./ox-input-duration.js": "./dist/src/ox-input-duration.js",
|
34
|
+
"./ox-input-quantifier.js": "./dist/src/ox-input-quantifier.js",
|
33
35
|
"./ox-input-stack.js": "./dist/src/ox-input-stack.js",
|
34
36
|
"./ox-input-range.js": "./dist/src/ox-input-range.js",
|
37
|
+
"./ox-input-key-values.js": "./dist/src/ox-input-key-values.js",
|
35
38
|
"./ox-select.js": "./dist/src/ox-select.js",
|
36
39
|
"./ox-input-file.js": "./dist/src/ox-input-file.js",
|
37
40
|
"./ox-input-image.js": "./dist/src/ox-input-image.js",
|
@@ -58,36 +61,36 @@
|
|
58
61
|
},
|
59
62
|
"dependencies": {
|
60
63
|
"@lit/localize": "^0.11.2",
|
61
|
-
"@material/mwc-icon": "^0.
|
62
|
-
"@operato/color-picker": "^1.0.0
|
63
|
-
"@operato/i18n": "^1.0.0
|
64
|
-
"@operato/popup": "^1.0.0
|
65
|
-
"@operato/styles": "^1.0.0
|
66
|
-
"@operato/utils": "^1.0.0
|
64
|
+
"@material/mwc-icon": "^0.26.1",
|
65
|
+
"@operato/color-picker": "^1.0.0",
|
66
|
+
"@operato/i18n": "^1.0.0",
|
67
|
+
"@operato/popup": "^1.0.0",
|
68
|
+
"@operato/styles": "^1.0.0",
|
69
|
+
"@operato/utils": "^1.0.0",
|
67
70
|
"@polymer/paper-dropdown-menu": "^3.2.0",
|
68
71
|
"@polymer/paper-item": "^3.0.1",
|
69
72
|
"@thebespokepixel/es-tinycolor": "^3.1.0",
|
70
|
-
"@zxing/library": "^0.
|
73
|
+
"@zxing/library": "^0.19.1",
|
71
74
|
"codemirror": "^5.64.0",
|
72
|
-
"lit": "^2.2.
|
75
|
+
"lit": "^2.2.7",
|
73
76
|
"lodash-es": "^4.17.21"
|
74
77
|
},
|
75
78
|
"devDependencies": {
|
76
79
|
"@custom-elements-manifest/analyzer": "^0.4.17",
|
77
80
|
"@hatiolab/prettier-config": "^1.0.0",
|
78
|
-
"@lit/localize-tools": "^0.6.
|
81
|
+
"@lit/localize-tools": "^0.6.3",
|
79
82
|
"@open-wc/eslint-config": "^4.3.0",
|
80
83
|
"@open-wc/testing": "^3.0.4",
|
81
84
|
"@types/codemirror": "^5.60.5",
|
82
85
|
"@typescript-eslint/eslint-plugin": "^4.33.0",
|
83
86
|
"@typescript-eslint/parser": "^4.33.0",
|
84
87
|
"@web/dev-server": "^0.1.29",
|
85
|
-
"@web/dev-server-storybook": "
|
88
|
+
"@web/dev-server-storybook": "^0.5.0",
|
86
89
|
"@web/test-runner": "next",
|
87
90
|
"concurrently": "^5.3.0",
|
88
91
|
"eslint": "^7.32.0",
|
89
92
|
"eslint-config-prettier": "^8.3.0",
|
90
|
-
"husky": "^
|
93
|
+
"husky": "^7.0.2",
|
91
94
|
"lint-staged": "^10.5.4",
|
92
95
|
"prettier": "^2.4.1",
|
93
96
|
"tslib": "^2.3.1",
|
@@ -106,5 +109,5 @@
|
|
106
109
|
"prettier --write"
|
107
110
|
]
|
108
111
|
},
|
109
|
-
"gitHead": "
|
112
|
+
"gitHead": "c383e4b11cb4195f32be9b0daa4342dda0bbb2ab"
|
110
113
|
}
|
package/src/index.ts
CHANGED
@@ -17,5 +17,7 @@ export * from './ox-input-value-ranges.js'
|
|
17
17
|
export * from './ox-input-value-map.js'
|
18
18
|
export * from './ox-input-table.js'
|
19
19
|
export * from './ox-input-scene-component-id.js'
|
20
|
-
export * from './ox-input-crontab'
|
21
|
-
export * from './ox-input-partition-keys'
|
20
|
+
export * from './ox-input-crontab.js'
|
21
|
+
export * from './ox-input-partition-keys.js'
|
22
|
+
export * from './ox-input-duration.js'
|
23
|
+
export * from './ox-input-quantifier.js'
|
package/src/locales/en.ts
CHANGED
@@ -16,5 +16,13 @@
|
|
16
16
|
'sf95fdd7da4fc2295': `translate`,
|
17
17
|
's6aacb9fbb71a1d91': `scale`,
|
18
18
|
's075cb2f53173bd8a': `rotate`,
|
19
|
+
'sc4bcadba8e631b86': `name`,
|
20
|
+
's63c6e58ec805a9eb': `from date`,
|
21
|
+
'sfcc01216c601ec9e': `from time`,
|
22
|
+
's685db98545dc9448': `to date`,
|
23
|
+
's77c8560cf63a372d': `to time`,
|
24
|
+
's42670fc325584e15': `The day before`,
|
25
|
+
's29ec9210c8a8222e': `The day`,
|
26
|
+
'scff69aa7239287b0': `The day after`,
|
19
27
|
};
|
20
28
|
|
package/src/locales/ko.ts
CHANGED
@@ -10,11 +10,19 @@
|
|
10
10
|
|
11
11
|
export const templates = {
|
12
12
|
's075cb2f53173bd8a': `회전`,
|
13
|
+
's29ec9210c8a8222e': `당일`,
|
13
14
|
's31be7a0b4a5853dd': `z 축`,
|
15
|
+
's42670fc325584e15': `전날`,
|
16
|
+
's63c6e58ec805a9eb': `시작일`,
|
17
|
+
's685db98545dc9448': `완료일`,
|
14
18
|
's6aacb9fbb71a1d91': `스케일`,
|
19
|
+
's77c8560cf63a372d': `완료시간`,
|
15
20
|
's9f41d726ecec72c2': `y 축`,
|
21
|
+
'sc4bcadba8e631b86': `이름`,
|
22
|
+
'scff69aa7239287b0': `다음날`,
|
16
23
|
'sd793f87f18747a63': `체적`,
|
17
24
|
'sf95fdd7da4fc2295': `변환`,
|
18
25
|
'sf9b52aece5aed0f7': `x 축`,
|
26
|
+
'sfcc01216c601ec9e': `시작시간`,
|
19
27
|
};
|
20
28
|
|
package/src/locales/ms.ts
CHANGED
@@ -16,5 +16,13 @@
|
|
16
16
|
'sf95fdd7da4fc2295': `translate`,
|
17
17
|
's6aacb9fbb71a1d91': `scale`,
|
18
18
|
's075cb2f53173bd8a': `rotate`,
|
19
|
+
'sc4bcadba8e631b86': `name`,
|
20
|
+
's63c6e58ec805a9eb': `from date`,
|
21
|
+
'sfcc01216c601ec9e': `from time`,
|
22
|
+
's685db98545dc9448': `to date`,
|
23
|
+
's77c8560cf63a372d': `to time`,
|
24
|
+
's42670fc325584e15': `The day before`,
|
25
|
+
's29ec9210c8a8222e': `The day`,
|
26
|
+
'scff69aa7239287b0': `The day after`,
|
19
27
|
};
|
20
28
|
|
package/src/locales/zh.ts
CHANGED
@@ -16,5 +16,13 @@
|
|
16
16
|
'sf95fdd7da4fc2295': `translate`,
|
17
17
|
's6aacb9fbb71a1d91': `scale`,
|
18
18
|
's075cb2f53173bd8a': `rotate`,
|
19
|
+
'sc4bcadba8e631b86': `name`,
|
20
|
+
's63c6e58ec805a9eb': `from date`,
|
21
|
+
'sfcc01216c601ec9e': `from time`,
|
22
|
+
's685db98545dc9448': `to date`,
|
23
|
+
's77c8560cf63a372d': `to time`,
|
24
|
+
's42670fc325584e15': `The day before`,
|
25
|
+
's29ec9210c8a8222e': `The day`,
|
26
|
+
'scff69aa7239287b0': `The day after`,
|
19
27
|
};
|
20
28
|
|
package/src/ox-input-3dish.ts
CHANGED
@@ -16,21 +16,37 @@ export class OxInput3Dish extends OxFormField {
|
|
16
16
|
css`
|
17
17
|
:host {
|
18
18
|
display: grid;
|
19
|
-
grid-template-columns: repeat(
|
20
|
-
grid-gap:
|
21
|
-
grid-auto-rows: minmax(24px, auto);
|
22
|
-
}
|
23
|
-
|
24
|
-
:host > * {
|
25
|
-
grid-column: span 1;
|
19
|
+
grid-template-columns: repeat(7, minmax(50px, 1fr));
|
20
|
+
grid-gap: var(--margin-default);
|
26
21
|
}
|
27
22
|
|
28
23
|
label {
|
29
24
|
text-align: right;
|
25
|
+
align-self: center;
|
26
|
+
font: var(--label-font);
|
27
|
+
color: var(--label-color);
|
28
|
+
text-transform: var(--label-text-transform);
|
29
|
+
grid-column: span 1;
|
30
30
|
}
|
31
31
|
|
32
32
|
span {
|
33
|
+
grid-column: span 2;
|
33
34
|
text-align: center;
|
35
|
+
font: var(--label-font);
|
36
|
+
color: var(--legend-color);
|
37
|
+
}
|
38
|
+
|
39
|
+
input {
|
40
|
+
grid-column: span 2;
|
41
|
+
border: 0;
|
42
|
+
border-bottom: var(--border-dark-color);
|
43
|
+
padding: var(--input-padding);
|
44
|
+
font: var(--input-font);
|
45
|
+
color: var(--primary-text-color);
|
46
|
+
}
|
47
|
+
input:focus {
|
48
|
+
outline: none;
|
49
|
+
border-bottom: 1px solid var(--primary-color);
|
34
50
|
}
|
35
51
|
`
|
36
52
|
]
|
@@ -154,7 +170,7 @@ export class OxInput3Dish extends OxFormField {
|
|
154
170
|
|
155
171
|
render() {
|
156
172
|
return html`
|
157
|
-
<
|
173
|
+
<label></label> <span>${msg('x-axes')}</span>
|
158
174
|
<span>${msg('y-axes')}</span>
|
159
175
|
<span>${msg('z-axes')}</span>
|
160
176
|
|
package/src/ox-input-barcode.ts
CHANGED
@@ -3,9 +3,10 @@ import '@operato/popup/ox-popup.js'
|
|
3
3
|
import { css, html } from 'lit'
|
4
4
|
import { customElement, property, query, state } from 'lit/decorators.js'
|
5
5
|
|
6
|
+
import { OxPopup } from '@operato/popup'
|
6
7
|
import { BrowserMultiFormatReader } from '@zxing/library'
|
8
|
+
|
7
9
|
import { OxFormField } from './ox-form-field.js'
|
8
|
-
import { OxPopup } from '@operato/popup'
|
9
10
|
|
10
11
|
const barcodeIcon = `data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAYBAMAAAAfR1CMAAADKGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxNDUgNzkuMTYzNDk5LCAyMDE4LzA4LzEzLTE2OjQwOjIyICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ0MgMjAxOSAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpFNjM4RURDQkQ1OUExMUU5QkExMkQ4NUY3NkMxNzBFOSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpFNjM4RURDQ0Q1OUExMUU5QkExMkQ4NUY3NkMxNzBFOSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkU2MzhFREM5RDU5QTExRTlCQTEyRDg1Rjc2QzE3MEU5IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkU2MzhFRENBRDU5QTExRTlCQTEyRDg1Rjc2QzE3MEU5Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+55pr/QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAAkUExURQAAAEdwTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEus/7UCWQwAAAALdFJOU9YAg3wKBFBDSz9PnvQNDgAAAE9JREFUGNNjEEQFDKLJSnCOklkgg9QUJFn3RgZhRyS+iCGDEIp2RSBfQICRkRGIgTSQL4jCF6ScvxsZYOFT2T50/6D7Fz080MMLPTzRwhsAHVspfelur08AAAAASUVORK5CYII=`
|
11
12
|
|
@@ -17,10 +18,6 @@ export class OxInputBarcode extends OxFormField {
|
|
17
18
|
display: flex;
|
18
19
|
align-items: center;
|
19
20
|
border: none;
|
20
|
-
overflow: hidden;
|
21
|
-
background-color: #fff;
|
22
|
-
|
23
|
-
padding: var(--custom-input-barcode-field-padding) !important;
|
24
21
|
}
|
25
22
|
|
26
23
|
* {
|
@@ -32,23 +29,27 @@ export class OxInputBarcode extends OxFormField {
|
|
32
29
|
}
|
33
30
|
|
34
31
|
input {
|
35
|
-
flex: 1
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
32
|
+
flex: 1;
|
33
|
+
width: 10px; /* intentionally width set */
|
34
|
+
border: 0;
|
35
|
+
border-bottom: var(--border-dark-color);
|
36
|
+
padding: var(--input-padding);
|
37
|
+
padding-right: 35px;
|
38
|
+
font: var(--input-font);
|
39
|
+
color: var(--primary-text-color);
|
40
|
+
}
|
41
|
+
input:focus {
|
42
|
+
outline: none;
|
43
|
+
border-bottom: 1px solid var(--primary-color);
|
40
44
|
}
|
41
45
|
|
42
46
|
#scan-button {
|
43
47
|
display: block;
|
48
|
+
position: relative;
|
49
|
+
margin-left: -30px;
|
44
50
|
width: 30px;
|
45
|
-
height: 100%;
|
46
|
-
min-height: 24px;
|
47
51
|
border: none;
|
48
|
-
background
|
49
|
-
background-repeat: no-repeat;
|
50
|
-
background-position: center;
|
51
|
-
background-image: var(--barcodescan-input-button-icon);
|
52
|
+
background: var(--barcodescan-input-button-icon) no-repeat center center;
|
52
53
|
}
|
53
54
|
|
54
55
|
#scan-button[hidden] {
|
@@ -84,6 +85,8 @@ export class OxInputBarcode extends OxFormField {
|
|
84
85
|
@property({ type: Boolean }) scannable?: boolean
|
85
86
|
@property({ attribute: 'without-enter', type: Boolean }) withoutEnter?: boolean
|
86
87
|
@property({ type: String }) declare value?: string
|
88
|
+
@property({ attribute: 'english-only', type: Boolean }) englishOnly?: boolean
|
89
|
+
@property({ attribute: 'select-after-change', type: Boolean }) selectAfterChange?: boolean
|
87
90
|
|
88
91
|
@state() stream?: MediaStream
|
89
92
|
@state() reader?: BrowserMultiFormatReader
|
@@ -123,9 +126,8 @@ export class OxInputBarcode extends OxFormField {
|
|
123
126
|
<input
|
124
127
|
type="text"
|
125
128
|
.value=${this.value || ''}
|
126
|
-
|
127
|
-
@
|
128
|
-
@keypress=${(e: Event) => this.onChange(e)}
|
129
|
+
@change=${(e: Event) => this.onInputChange(e)}
|
130
|
+
@keydown=${(e: KeyboardEvent) => this.onInputKeyDown(e)}
|
129
131
|
/>
|
130
132
|
<button
|
131
133
|
?hidden=${!this.scannable}
|
@@ -145,11 +147,49 @@ export class OxInputBarcode extends OxFormField {
|
|
145
147
|
`
|
146
148
|
}
|
147
149
|
|
148
|
-
|
150
|
+
onInputChange(e: Event) {
|
149
151
|
e.stopPropagation()
|
150
|
-
|
151
|
-
|
152
|
-
|
152
|
+
|
153
|
+
if (this.englishOnly) {
|
154
|
+
/* englishOnly 인 경우에는 멀티바이트 문자들을 모두 제거한다. */
|
155
|
+
this.value = this.input.value = this.input.value?.replace(/[^\x00-\x7F]/g, '')
|
156
|
+
} else {
|
157
|
+
this.value = this.input.value
|
158
|
+
}
|
159
|
+
|
160
|
+
if (this.selectAfterChange) {
|
161
|
+
requestAnimationFrame(() => {
|
162
|
+
this.input.select()
|
163
|
+
})
|
164
|
+
}
|
165
|
+
|
166
|
+
this.dispatchEvent(
|
167
|
+
new CustomEvent('change', {
|
168
|
+
detail: this.value
|
169
|
+
})
|
170
|
+
)
|
171
|
+
}
|
172
|
+
|
173
|
+
onInputKeyDown(e: KeyboardEvent) {
|
174
|
+
if (e.key === 'Enter' && !e.isComposing) {
|
175
|
+
/* Even if the value has not changed, the enter key triggers a change event. */
|
176
|
+
e.preventDefault() /* Prevent change event from occurring twice. */
|
177
|
+
|
178
|
+
this.input.dispatchEvent(new CustomEvent('change'))
|
179
|
+
} else if (this.englishOnly && !e.metaKey && !e.ctrlKey && !e.altKey && /^Key/.test(e.code)) {
|
180
|
+
e.stopPropagation()
|
181
|
+
e.preventDefault()
|
182
|
+
|
183
|
+
/* englishOnly 인 경우에 문자들은 여기에서 처리한다. 멀티바이트 문자들이 대부분 알파벳의 자모음을 조합하므로, ... */
|
184
|
+
const key = e.shiftKey ? e.code.charAt(3) : e.code.charAt(3).toLowerCase()
|
185
|
+
const value = this.input.value
|
186
|
+
|
187
|
+
const start = this.input.selectionStart || 0
|
188
|
+
const end = this.input.selectionEnd || start
|
189
|
+
|
190
|
+
this.input.value = [value.substring(0, start), key, value.substring(end)].join('')
|
191
|
+
this.input.setSelectionRange(start + 1, start + 1)
|
192
|
+
}
|
153
193
|
}
|
154
194
|
|
155
195
|
async scan(e: MouseEvent) {
|
@@ -170,14 +210,7 @@ export class OxInputBarcode extends OxFormField {
|
|
170
210
|
this.value = input.value = String(result)
|
171
211
|
|
172
212
|
if (!this.withoutEnter) {
|
173
|
-
input.dispatchEvent(new KeyboardEvent('
|
174
|
-
input.dispatchEvent(
|
175
|
-
new CustomEvent('change', {
|
176
|
-
bubbles: true,
|
177
|
-
composed: true,
|
178
|
-
detail: this.value
|
179
|
-
})
|
180
|
-
)
|
213
|
+
input.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter' }))
|
181
214
|
}
|
182
215
|
} else {
|
183
216
|
/* popup이 비동기 진행 중에 close된 경우라면, stopScan()을 처리하지 못하게 되므로, 다시한번 clear해준다. */
|
@@ -197,10 +230,10 @@ export class OxInputBarcode extends OxFormField {
|
|
197
230
|
}
|
198
231
|
|
199
232
|
stopScan() {
|
200
|
-
this.video
|
233
|
+
this.video?.pause()
|
201
234
|
|
202
|
-
this.stream
|
203
|
-
this.reader
|
235
|
+
this.stream?.getTracks().forEach(track => track.stop())
|
236
|
+
this.reader?.reset()
|
204
237
|
|
205
238
|
delete this.stream
|
206
239
|
delete this.reader
|
package/src/ox-input-color.ts
CHANGED
@@ -7,9 +7,10 @@ import '@operato/color-picker/paper-color-picker.js'
|
|
7
7
|
import { css, html } from 'lit'
|
8
8
|
import { customElement, property } from 'lit/decorators.js'
|
9
9
|
|
10
|
-
import { OxFormField } from './ox-form-field'
|
11
10
|
import { tinycolor } from '@thebespokepixel/es-tinycolor'
|
12
11
|
|
12
|
+
import { OxFormField } from './ox-form-field'
|
13
|
+
|
13
14
|
/**
|
14
15
|
색상을 입력하는데 사용되는 입력 컴포넌트이다.
|
15
16
|
화면상에는 두개의 입력 필드가 보이며, 하나는 색상값을 키보드로 직접 입력하는 입력 픽드이며,
|
@@ -180,18 +181,24 @@ export class OxInputColor extends OxFormField {
|
|
180
181
|
}
|
181
182
|
|
182
183
|
input[type='text'] {
|
183
|
-
padding-right: 24px;
|
184
184
|
width: 100%;
|
185
|
-
|
186
|
-
|
187
|
-
|
185
|
+
border: 0;
|
186
|
+
border-bottom: var(--border-dark-color);
|
187
|
+
padding: var(--input-padding);
|
188
|
+
font: var(--input-font);
|
189
|
+
color: var(--primary-text-color);
|
190
|
+
padding-right: 35px;
|
191
|
+
}
|
192
|
+
input:focus {
|
193
|
+
outline: none;
|
194
|
+
border-bottom: 1px solid var(--primary-color);
|
188
195
|
}
|
189
196
|
|
190
197
|
a {
|
191
198
|
-webkit-appearance: none;
|
192
199
|
display: flex;
|
193
200
|
position: absolute;
|
194
|
-
width:
|
201
|
+
width: 35px;
|
195
202
|
height: 100%;
|
196
203
|
box-sizing: border-box;
|
197
204
|
align-items: center;
|
@@ -199,11 +206,10 @@ export class OxInputColor extends OxFormField {
|
|
199
206
|
}
|
200
207
|
|
201
208
|
span {
|
202
|
-
width:
|
203
|
-
height:
|
204
|
-
|
205
|
-
border-radius:
|
206
|
-
border: 1px solid #eee;
|
209
|
+
width: 80%;
|
210
|
+
height: 60%;
|
211
|
+
border: var(--border-dark-color);
|
212
|
+
border-radius: var(--border-radius);
|
207
213
|
}
|
208
214
|
|
209
215
|
span.transparent {
|
package/src/ox-input-crontab.ts
CHANGED
@@ -84,7 +84,6 @@ export class OxInputCrontab extends OxFormField {
|
|
84
84
|
width: 100%;
|
85
85
|
height: 100%;
|
86
86
|
border: 0;
|
87
|
-
background-color: var(--main-section-background-color);
|
88
87
|
}
|
89
88
|
|
90
89
|
:host * {
|
@@ -118,32 +117,36 @@ export class OxInputCrontab extends OxFormField {
|
|
118
117
|
grid-column: 4 / span 3;
|
119
118
|
width: 100%;
|
120
119
|
height: 100%;
|
121
|
-
|
120
|
+
padding: var(--input-padding);
|
121
|
+
border: 0;
|
122
|
+
border-bottom: var(--border-dark-color);
|
122
123
|
text-transform: capitalize;
|
123
|
-
|
124
|
-
|
124
|
+
font: var(--label-font);
|
125
|
+
color: var(--label-color);
|
125
126
|
}
|
126
127
|
|
127
128
|
input {
|
128
129
|
width: 100%;
|
129
130
|
margin-top: var(--margin-default);
|
130
131
|
padding: 5px;
|
131
|
-
border
|
132
|
-
border: var(--border-dark-color);
|
133
|
-
|
132
|
+
border: 0;
|
133
|
+
border-bottom: var(--border-dark-color);
|
134
|
+
padding: var(--input-padding);
|
135
|
+
font: var(--input-font);
|
136
|
+
color: var(--primary-text-color);
|
134
137
|
}
|
135
138
|
input:focus {
|
136
|
-
|
139
|
+
outline: none;
|
140
|
+
border-bottom: 1px solid var(--primary-color);
|
137
141
|
}
|
138
142
|
|
139
143
|
input:invalid {
|
140
|
-
border: 1px solid var(--status-danger-color);
|
144
|
+
border-bottom: 1px solid var(--status-danger-color);
|
141
145
|
color: var(--status-danger-color);
|
142
146
|
}
|
143
147
|
|
144
148
|
label {
|
145
149
|
width: 100%;
|
146
|
-
height: 100%;
|
147
150
|
font: normal 0.8em var(--theme-font);
|
148
151
|
color: var(--primary-color);
|
149
152
|
}
|
@@ -370,6 +373,23 @@ export class OxInputCrontab extends OxFormField {
|
|
370
373
|
`
|
371
374
|
)}
|
372
375
|
</div>
|
376
|
+
<button
|
377
|
+
id="clear"
|
378
|
+
@click=${(e: Event) => {
|
379
|
+
e.preventDefault()
|
380
|
+
e.stopPropagation()
|
381
|
+
this.value = ''
|
382
|
+
this.dispatchEvent(
|
383
|
+
new CustomEvent('change', {
|
384
|
+
bubbles: true,
|
385
|
+
composed: true,
|
386
|
+
detail: this.value
|
387
|
+
})
|
388
|
+
)
|
389
|
+
}}
|
390
|
+
>
|
391
|
+
Clear
|
392
|
+
</button>
|
373
393
|
</form>
|
374
394
|
`
|
375
395
|
}
|
package/src/ox-input-data.ts
CHANGED
@@ -4,11 +4,11 @@
|
|
4
4
|
|
5
5
|
import './ox-input-code'
|
6
6
|
|
7
|
-
import {
|
7
|
+
import { css, html, PropertyValues } from 'lit'
|
8
|
+
import { customElement } from 'lit/decorators.js'
|
8
9
|
|
9
10
|
import { OxFormField } from './ox-form-field.js'
|
10
11
|
import { OxInputCode } from './ox-input-code.js'
|
11
|
-
import { customElement } from 'lit/decorators.js'
|
12
12
|
|
13
13
|
/**
|
14
14
|
WEB Component for code-mirror based data editor.
|