@operato/input 1.0.0-beta.3 → 1.0.0-beta.32

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.
Files changed (172) hide show
  1. package/.storybook/main.js +2 -2
  2. package/.storybook/server.mjs +4 -4
  3. package/CHANGELOG.md +495 -0
  4. package/demo/index-multiple-colors.html +4 -1
  5. package/demo/index-partition-keys.html +2 -5
  6. package/demo/index-select.html +1 -1
  7. package/demo/index.html +4 -0
  8. package/dist/src/index.d.ts +3 -2
  9. package/dist/src/index.js +3 -2
  10. package/dist/src/index.js.map +1 -1
  11. package/dist/src/locales/en.d.ts +8 -0
  12. package/dist/src/locales/en.js +8 -0
  13. package/dist/src/locales/en.js.map +1 -1
  14. package/dist/src/locales/ko.d.ts +8 -0
  15. package/dist/src/locales/ko.js +8 -0
  16. package/dist/src/locales/ko.js.map +1 -1
  17. package/dist/src/locales/ms.d.ts +8 -0
  18. package/dist/src/locales/ms.js +8 -0
  19. package/dist/src/locales/ms.js.map +1 -1
  20. package/dist/src/locales/zh.d.ts +8 -0
  21. package/dist/src/locales/zh.js +8 -0
  22. package/dist/src/locales/zh.js.map +1 -1
  23. package/dist/src/ox-input-3dish.js +24 -8
  24. package/dist/src/ox-input-3dish.js.map +1 -1
  25. package/dist/src/ox-input-barcode.d.ts +5 -2
  26. package/dist/src/ox-input-barcode.js +55 -19
  27. package/dist/src/ox-input-barcode.js.map +1 -1
  28. package/dist/src/ox-input-color.js +16 -11
  29. package/dist/src/ox-input-color.js.map +1 -1
  30. package/dist/src/ox-input-crontab.js +28 -10
  31. package/dist/src/ox-input-crontab.js.map +1 -1
  32. package/dist/src/ox-input-duration.d.ts +13 -0
  33. package/dist/src/ox-input-duration.js +138 -0
  34. package/dist/src/ox-input-duration.js.map +1 -0
  35. package/dist/src/ox-input-file.js +5 -3
  36. package/dist/src/ox-input-file.js.map +1 -1
  37. package/dist/src/ox-input-key-values.d.ts +41 -0
  38. package/dist/src/ox-input-key-values.js +233 -0
  39. package/dist/src/ox-input-key-values.js.map +1 -0
  40. package/dist/src/ox-input-multiple-colors.d.ts +1 -0
  41. package/dist/src/ox-input-multiple-colors.js +29 -21
  42. package/dist/src/ox-input-multiple-colors.js.map +1 -1
  43. package/dist/src/ox-input-options.d.ts +1 -0
  44. package/dist/src/ox-input-options.js +54 -14
  45. package/dist/src/ox-input-options.js.map +1 -1
  46. package/dist/src/ox-input-partition-keys.d.ts +1 -0
  47. package/dist/src/ox-input-partition-keys.js +51 -23
  48. package/dist/src/ox-input-partition-keys.js.map +1 -1
  49. package/dist/src/ox-input-range.js +35 -38
  50. package/dist/src/ox-input-range.js.map +1 -1
  51. package/dist/src/ox-input-search.d.ts +0 -1
  52. package/dist/src/ox-input-search.js +14 -7
  53. package/dist/src/ox-input-search.js.map +1 -1
  54. package/dist/src/ox-input-unit.d.ts +17 -0
  55. package/dist/src/ox-input-unit.js +122 -0
  56. package/dist/src/ox-input-unit.js.map +1 -0
  57. package/dist/src/ox-input-value-map.d.ts +2 -2
  58. package/dist/src/ox-input-value-map.js +51 -15
  59. package/dist/src/ox-input-value-map.js.map +1 -1
  60. package/dist/src/ox-input-value-ranges.d.ts +2 -2
  61. package/dist/src/ox-input-value-ranges.js +50 -23
  62. package/dist/src/ox-input-value-ranges.js.map +1 -1
  63. package/dist/src/ox-input-work-shift.js +77 -43
  64. package/dist/src/ox-input-work-shift.js.map +1 -1
  65. package/dist/src/ox-select.js +9 -1
  66. package/dist/src/ox-select.js.map +1 -1
  67. package/dist/stories/ox-checkbox.stories.d.ts +39 -0
  68. package/dist/stories/ox-checkbox.stories.js +44 -0
  69. package/dist/stories/ox-checkbox.stories.js.map +1 -0
  70. package/dist/stories/ox-input-3dish.stories.d.ts +26 -0
  71. package/dist/stories/ox-input-3dish.stories.js +59 -0
  72. package/dist/stories/ox-input-3dish.stories.js.map +1 -0
  73. package/dist/stories/ox-input-barcode.stories.d.ts +43 -0
  74. package/dist/stories/ox-input-barcode.stories.js +50 -0
  75. package/dist/stories/ox-input-barcode.stories.js.map +1 -0
  76. package/dist/stories/ox-input-crontab.stories.d.ts +26 -0
  77. package/dist/stories/ox-input-crontab.stories.js +37 -0
  78. package/dist/stories/ox-input-crontab.stories.js.map +1 -0
  79. package/dist/stories/ox-input-duration.stories.d.ts +26 -0
  80. package/dist/stories/ox-input-duration.stories.js +37 -0
  81. package/dist/stories/ox-input-duration.stories.js.map +1 -0
  82. package/dist/stories/ox-input-file.stories.d.ts +49 -0
  83. package/dist/stories/ox-input-file.stories.js +48 -0
  84. package/dist/stories/ox-input-file.stories.js.map +1 -0
  85. package/dist/stories/{index.stories.d.ts → ox-input-key-values.stories.d.ts} +7 -11
  86. package/dist/stories/ox-input-key-values.stories.js +49 -0
  87. package/dist/stories/ox-input-key-values.stories.js.map +1 -0
  88. package/dist/stories/ox-input-multiple-colors.stories.d.ts +20 -0
  89. package/dist/stories/ox-input-multiple-colors.stories.js +167 -0
  90. package/dist/stories/ox-input-multiple-colors.stories.js.map +1 -0
  91. package/dist/stories/ox-input-options.stories.d.ts +25 -0
  92. package/dist/stories/ox-input-options.stories.js +33 -0
  93. package/dist/stories/ox-input-options.stories.js.map +1 -0
  94. package/dist/stories/ox-input-partition-keys.stories.d.ts +25 -0
  95. package/dist/stories/ox-input-partition-keys.stories.js +37 -0
  96. package/dist/stories/ox-input-partition-keys.stories.js.map +1 -0
  97. package/dist/stories/ox-input-range.stories.d.ts +37 -0
  98. package/dist/stories/ox-input-range.stories.js +28 -0
  99. package/dist/stories/ox-input-range.stories.js.map +1 -0
  100. package/dist/stories/ox-input-search.stories.d.ts +29 -0
  101. package/dist/stories/ox-input-search.stories.js +32 -0
  102. package/dist/stories/ox-input-search.stories.js.map +1 -0
  103. package/dist/stories/ox-input-unit.stories.d.ts +40 -0
  104. package/dist/stories/ox-input-unit.stories.js +42 -0
  105. package/dist/stories/ox-input-unit.stories.js.map +1 -0
  106. package/dist/stories/ox-input-value-map.stories.d.ts +35 -0
  107. package/dist/stories/ox-input-value-map.stories.js +37 -0
  108. package/dist/stories/ox-input-value-map.stories.js.map +1 -0
  109. package/dist/stories/ox-input-value-ranges.stories.d.ts +35 -0
  110. package/dist/stories/ox-input-value-ranges.stories.js +37 -0
  111. package/dist/stories/ox-input-value-ranges.stories.js.map +1 -0
  112. package/dist/stories/ox-input-work-shift.stories.d.ts +26 -0
  113. package/dist/stories/ox-input-work-shift.stories.js +59 -0
  114. package/dist/stories/ox-input-work-shift.stories.js.map +1 -0
  115. package/dist/stories/ox-select.stories.d.ts +30 -0
  116. package/dist/stories/ox-select.stories.js +83 -0
  117. package/dist/stories/ox-select.stories.js.map +1 -0
  118. package/dist/themes/common-grist-styles.d.ts +1 -0
  119. package/dist/themes/common-grist-styles.js +110 -0
  120. package/dist/themes/common-grist-styles.js.map +1 -0
  121. package/dist/tsconfig.tsbuildinfo +1 -1
  122. package/package.json +13 -11
  123. package/src/index.ts +3 -2
  124. package/src/locales/en.ts +8 -0
  125. package/src/locales/ko.ts +8 -0
  126. package/src/locales/ms.ts +8 -0
  127. package/src/locales/zh.ts +8 -0
  128. package/src/ox-input-3dish.ts +24 -8
  129. package/src/ox-input-barcode.ts +61 -20
  130. package/src/ox-input-color.ts +17 -11
  131. package/src/ox-input-crontab.ts +30 -10
  132. package/src/ox-input-duration.ts +143 -0
  133. package/src/ox-input-file.ts +7 -6
  134. package/src/ox-input-key-values.ts +270 -0
  135. package/src/ox-input-multiple-colors.ts +29 -21
  136. package/src/ox-input-options.ts +53 -13
  137. package/src/ox-input-partition-keys.ts +51 -22
  138. package/src/ox-input-range.ts +35 -38
  139. package/src/ox-input-search.ts +14 -8
  140. package/src/ox-input-unit.ts +123 -0
  141. package/src/ox-input-value-map.ts +52 -16
  142. package/src/ox-input-value-ranges.ts +52 -25
  143. package/src/ox-input-work-shift.ts +78 -43
  144. package/src/ox-select.ts +12 -3
  145. package/stories/ox-checkbox.stories.ts +69 -0
  146. package/stories/ox-input-3dish.stories.ts +73 -0
  147. package/stories/ox-input-barcode.stories.ts +76 -0
  148. package/stories/ox-input-code.stories.ts_ +51 -0
  149. package/stories/ox-input-crontab.stories.ts +51 -0
  150. package/stories/ox-input-duration.stories.ts +51 -0
  151. package/stories/ox-input-file.stories.ts +77 -0
  152. package/stories/ox-input-key-values.stories.ts +64 -0
  153. package/stories/ox-input-multiple-colors.stories.ts +178 -0
  154. package/stories/ox-input-options.stories.ts +47 -0
  155. package/stories/ox-input-partition-keys.stories.ts +51 -0
  156. package/stories/ox-input-range.stories.ts +45 -0
  157. package/stories/ox-input-search.stories.ts +47 -0
  158. package/stories/ox-input-unit.stories.ts +66 -0
  159. package/stories/ox-input-value-map.stories.ts +58 -0
  160. package/stories/ox-input-value-ranges.stories.ts +58 -0
  161. package/stories/ox-input-work-shift.stories.ts +73 -0
  162. package/stories/ox-select.stories.ts +101 -0
  163. package/themes/app-theme.css +142 -0
  164. package/themes/common-grist-styles.ts +110 -0
  165. package/themes/input-theme.css +19 -0
  166. package/xliff/en.xlf +24 -0
  167. package/xliff/ko.xlf +32 -0
  168. package/xliff/ms.xlf +24 -0
  169. package/xliff/zh.xlf +24 -0
  170. package/dist/stories/index.stories.js +0 -33
  171. package/dist/stories/index.stories.js.map +0 -1
  172. package/stories/index.stories.ts +0 -52
@@ -0,0 +1,47 @@
1
+ import '../src/ox-input-options.js'
2
+
3
+ import { html, TemplateResult } from 'lit'
4
+
5
+ export default {
6
+ title: 'ox-input-options',
7
+ component: 'ox-input-options',
8
+ argTypes: {
9
+ value: { control: 'object' },
10
+ name: { control: 'text' }
11
+ }
12
+ }
13
+
14
+ interface Story<T> {
15
+ (args: T): TemplateResult
16
+ args?: Partial<T>
17
+ argTypes?: Record<string, unknown>
18
+ }
19
+
20
+ interface ArgTypes {
21
+ name?: string
22
+ value?: object
23
+ }
24
+
25
+ const Template: Story<ArgTypes> = ({ name = 'options', value = {} }: ArgTypes) => html`
26
+ <link href="/themes/app-theme.css" rel="stylesheet" />
27
+ <link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet" />
28
+ <style>
29
+ body {
30
+ }
31
+ </style>
32
+
33
+ <ox-input-options
34
+ @change=${(e: Event) => {
35
+ console.log((e.target as HTMLInputElement).value)
36
+ }}
37
+ name=${name}
38
+ .value=${value}
39
+ >
40
+ </ox-input-options>
41
+ `
42
+
43
+ export const Regular = Template.bind({})
44
+ Regular.args = {
45
+ name: 'options',
46
+ value: [{ text: 'SHOOSE', value: 'Shoose' }]
47
+ }
@@ -0,0 +1,51 @@
1
+ import '../src/ox-input-partition-keys.js'
2
+
3
+ import { html, TemplateResult } from 'lit'
4
+
5
+ export default {
6
+ title: 'ox-input-partition-keys',
7
+ component: 'ox-input-partition-keys',
8
+ argTypes: {
9
+ value: { control: 'object' },
10
+ name: { control: 'text' }
11
+ }
12
+ }
13
+
14
+ interface Story<T> {
15
+ (args: T): TemplateResult
16
+ args?: Partial<T>
17
+ argTypes?: Record<string, unknown>
18
+ }
19
+
20
+ interface ArgTypes {
21
+ name?: string
22
+ value?: object
23
+ }
24
+
25
+ const Template: Story<ArgTypes> = ({ name = 'partition-keys', value = {} }: ArgTypes) => html`
26
+ <link href="/themes/app-theme.css" rel="stylesheet" />
27
+ <link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet" />
28
+ <style>
29
+ body {
30
+ }
31
+ </style>
32
+
33
+ <ox-input-partition-keys
34
+ @change=${(e: Event) => {
35
+ console.log((e.target as HTMLInputElement).value)
36
+ }}
37
+ name=${name}
38
+ .value=${value}
39
+ >
40
+ </ox-input-partition-keys>
41
+ `
42
+
43
+ export const Regular = Template.bind({})
44
+ Regular.args = {
45
+ name: 'partition-keys',
46
+ value: {
47
+ A: 'A',
48
+ B: 'B',
49
+ C: 'C'
50
+ }
51
+ }
@@ -0,0 +1,45 @@
1
+ import '../src/ox-input-range.js'
2
+
3
+ import { html, TemplateResult } from 'lit'
4
+
5
+ export default {
6
+ title: 'ox-input-range',
7
+ component: 'ox-input-range',
8
+ argTypes: {
9
+ name: { control: 'text' },
10
+ value: { control: 'number' },
11
+ step: { control: 'number' },
12
+ min: { control: 'number' },
13
+ max: { control: 'number' }
14
+ }
15
+ }
16
+
17
+ interface Story<T> {
18
+ (args: T): TemplateResult
19
+ args?: Partial<T>
20
+ argTypes?: Record<string, unknown>
21
+ }
22
+
23
+ interface ArgTypes {
24
+ name?: string
25
+ value?: number
26
+ step?: number
27
+ min?: number
28
+ max?: number
29
+ }
30
+
31
+ const Template: Story<ArgTypes> = ({ name = 'range', value = 0, step = 1, min = 0, max = 100 }: ArgTypes) => html`
32
+ <link href="/themes/app-theme.css" rel="stylesheet" />
33
+ <link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet" />
34
+
35
+ <ox-input-range name=${name} value=${value} step=${step} min=${min} max=${max}> </ox-input-range>
36
+ `
37
+
38
+ export const Regular = Template.bind({})
39
+ Regular.args = {
40
+ name: 'range',
41
+ value: 0,
42
+ step: 1,
43
+ min: 0,
44
+ max: 100
45
+ }
@@ -0,0 +1,47 @@
1
+ import '../src/ox-input-search.js'
2
+
3
+ import { html, TemplateResult } from 'lit'
4
+
5
+ export default {
6
+ title: 'ox-input-search',
7
+ component: 'ox-input-search',
8
+ argTypes: {
9
+ placeholder: { control: 'text' },
10
+ name: { control: 'text' },
11
+ value: { control: 'text' }
12
+ }
13
+ }
14
+
15
+ interface Story<T> {
16
+ (args: T): TemplateResult
17
+ args?: Partial<T>
18
+ argTypes?: Record<string, unknown>
19
+ }
20
+
21
+ interface ArgTypes {
22
+ placeholder?: string
23
+ name?: string
24
+ value?: string
25
+ }
26
+
27
+ const Template: Story<ArgTypes> = ({ placeholder = 'Search', name = 'hello', value = '' }: ArgTypes) => html`
28
+ <link href="/themes/app-theme.css" rel="stylesheet" />
29
+ <link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet" />
30
+ <style>
31
+ body {
32
+ }
33
+ </style>
34
+
35
+ <ox-input-search
36
+ @change=${(e: Event) => console.log('changed', (e.target as HTMLInputElement).value)}
37
+ name=${name}
38
+ .checked=${value}
39
+ >
40
+ </ox-input-search>
41
+ `
42
+
43
+ export const Regular = Template.bind({})
44
+ Regular.args = {
45
+ placeholder: 'label',
46
+ name: 'label'
47
+ }
@@ -0,0 +1,66 @@
1
+ import '../src/ox-input-unit.js'
2
+
3
+ import { html, TemplateResult } from 'lit'
4
+
5
+ export default {
6
+ title: 'ox-input-unit',
7
+ component: 'ox-input-unit',
8
+ argTypes: {
9
+ placeholder: { control: 'text' },
10
+ name: { control: 'text' },
11
+ value: { control: 'number' },
12
+ stdUnit: { control: 'select', options: ['kg', 'rad'] },
13
+ userUnit: { control: 'select', options: ['mg', 'g', 'ton', 'degree'] }
14
+ }
15
+ }
16
+
17
+ interface Story<T> {
18
+ (args: T): TemplateResult
19
+ args?: Partial<T>
20
+ argTypes?: Record<string, unknown>
21
+ }
22
+
23
+ interface ArgTypes {
24
+ placeholder?: string
25
+ name?: string
26
+ value?: number
27
+ stdUnit: string
28
+ userUnit?: string
29
+ }
30
+
31
+ const Template: Story<ArgTypes> = ({
32
+ placeholder = 'unit',
33
+ name = 'hello',
34
+ value = 0,
35
+ stdUnit = 'kg',
36
+ userUnit
37
+ }: ArgTypes) => html`
38
+ <link href="/themes/app-theme.css" rel="stylesheet" />
39
+ <ox-input-unit
40
+ name=${name}
41
+ placeholder=${placeholder}
42
+ .value=${value}
43
+ std-unit=${stdUnit}
44
+ user-unit=${userUnit}
45
+ @change=${(e: CustomEvent) => console.log(e.detail)}
46
+ >
47
+ </ox-input-unit>
48
+ `
49
+
50
+ export const Weight = Template.bind({})
51
+ Weight.args = {
52
+ placeholder: 'weight',
53
+ name: 'weight',
54
+ value: 0,
55
+ stdUnit: 'kg',
56
+ userUnit: 'g'
57
+ }
58
+
59
+ export const Angle = Template.bind({})
60
+ Angle.args = {
61
+ placeholder: 'angle',
62
+ name: 'angle',
63
+ value: 0,
64
+ stdUnit: 'rad',
65
+ userUnit: 'degree'
66
+ }
@@ -0,0 +1,58 @@
1
+ import '../src/ox-input-value-map.js'
2
+
3
+ import { html, TemplateResult } from 'lit'
4
+
5
+ export default {
6
+ title: 'ox-input-value-map',
7
+ component: 'ox-input-value-map',
8
+ argTypes: {
9
+ name: { control: 'text' },
10
+ value: { control: 'object' },
11
+ keytype: { control: 'select', options: ['string', 'number'] },
12
+ valuetype: { control: 'select', options: ['string', 'boolean', 'number', 'color', 'date'] }
13
+ }
14
+ }
15
+
16
+ interface Story<T> {
17
+ (args: T): TemplateResult
18
+ args?: Partial<T>
19
+ argTypes?: Record<string, unknown>
20
+ }
21
+
22
+ interface ArgTypes {
23
+ name?: string
24
+ value?: object
25
+ valuetype?: string
26
+ keytype?: string
27
+ }
28
+
29
+ const Template: Story<ArgTypes> = ({
30
+ name = 'values',
31
+ value = {},
32
+ keytype = 'string',
33
+ valuetype = 'string'
34
+ }: ArgTypes) => html`
35
+ <link href="/themes/app-theme.css" rel="stylesheet" />
36
+ <link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet" />
37
+ <style>
38
+ body {
39
+ }
40
+ </style>
41
+
42
+ <ox-input-value-map
43
+ @change=${(e: Event) => {
44
+ console.log((e.target as HTMLInputElement).value)
45
+ }}
46
+ name=${name}
47
+ .value=${value}
48
+ keytype=${keytype}
49
+ valuetype=${valuetype}
50
+ >
51
+ </ox-input-value-map>
52
+ `
53
+
54
+ export const Regular = Template.bind({})
55
+ Regular.args = {
56
+ name: 'values',
57
+ value: {}
58
+ }
@@ -0,0 +1,58 @@
1
+ import '../src/ox-input-value-ranges.js'
2
+
3
+ import { html, TemplateResult } from 'lit'
4
+
5
+ export default {
6
+ title: 'ox-input-value-ranges',
7
+ component: 'ox-input-value-ranges',
8
+ argTypes: {
9
+ name: { control: 'text' },
10
+ value: { control: 'object' },
11
+ keytype: { control: 'select', options: ['string', 'number'] },
12
+ valuetype: { control: 'select', options: ['string', 'boolean', 'number', 'color', 'date'] }
13
+ }
14
+ }
15
+
16
+ interface Story<T> {
17
+ (args: T): TemplateResult
18
+ args?: Partial<T>
19
+ argTypes?: Record<string, unknown>
20
+ }
21
+
22
+ interface ArgTypes {
23
+ name?: string
24
+ value?: object
25
+ valuetype?: string
26
+ keytype?: string
27
+ }
28
+
29
+ const Template: Story<ArgTypes> = ({
30
+ name = 'values',
31
+ value = {},
32
+ keytype = 'string',
33
+ valuetype = 'string'
34
+ }: ArgTypes) => html`
35
+ <link href="/themes/app-theme.css" rel="stylesheet" />
36
+ <link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet" />
37
+ <style>
38
+ body {
39
+ }
40
+ </style>
41
+
42
+ <ox-input-value-ranges
43
+ @change=${(e: Event) => {
44
+ console.log((e.target as HTMLInputElement).value)
45
+ }}
46
+ name=${name}
47
+ .value=${value}
48
+ keytype=${keytype}
49
+ valuetype=${valuetype}
50
+ >
51
+ </ox-input-value-ranges>
52
+ `
53
+
54
+ export const Regular = Template.bind({})
55
+ Regular.args = {
56
+ name: 'values',
57
+ value: {}
58
+ }
@@ -0,0 +1,73 @@
1
+ import '../src/ox-input-work-shift.js'
2
+ import '../src/locale/locale-picker.js'
3
+
4
+ import { html, TemplateResult } from 'lit'
5
+
6
+ export default {
7
+ title: 'ox-input-work-shift',
8
+ component: 'ox-input-work-shift',
9
+ argTypes: {
10
+ value: { control: 'object' },
11
+ name: { control: 'text' }
12
+ }
13
+ }
14
+
15
+ interface Story<T> {
16
+ (args: T): TemplateResult
17
+ args?: Partial<T>
18
+ argTypes?: Record<string, unknown>
19
+ }
20
+
21
+ interface ArgTypes {
22
+ name?: string
23
+ value?: object
24
+ }
25
+
26
+ const Template: Story<ArgTypes> = ({ name = 'work-shift', value = [] }: ArgTypes) => html`
27
+ <link href="/themes/app-theme.css" rel="stylesheet" />
28
+ <link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet" />
29
+ <style>
30
+ body {
31
+ }
32
+ </style>
33
+
34
+ <locale-picker></locale-picker>
35
+ <br /><br />
36
+
37
+ <ox-input-work-shift
38
+ @change=${(e: Event) => {
39
+ console.log((e.target as HTMLInputElement).value)
40
+ }}
41
+ name=${name}
42
+ .value=${value}
43
+ >
44
+ </ox-input-work-shift>
45
+ `
46
+
47
+ export const Regular = Template.bind({})
48
+ Regular.args = {
49
+ name: 'work-shift',
50
+ value: [
51
+ {
52
+ name: 'DAY',
53
+ fromDate: -1,
54
+ fromTime: '22:00',
55
+ toDate: 0,
56
+ toTime: '06:00'
57
+ },
58
+ {
59
+ name: 'SWING',
60
+ fromDate: 0,
61
+ fromTime: '06:00',
62
+ toDate: 0,
63
+ toTime: '14:00'
64
+ },
65
+ {
66
+ name: 'NIGHT',
67
+ fromDate: 0,
68
+ fromTime: '14:00',
69
+ toDate: 0,
70
+ toTime: '22:00'
71
+ }
72
+ ]
73
+ }
@@ -0,0 +1,101 @@
1
+ import '../src/ox-select.js'
2
+ import '../src/ox-checkbox.js'
3
+
4
+ import { html, TemplateResult } from 'lit'
5
+
6
+ export default {
7
+ title: 'ox-select',
8
+ component: 'ox-select',
9
+ argTypes: {
10
+ placeholder: { control: 'text' },
11
+ name: { control: 'text' }
12
+ }
13
+ }
14
+
15
+ interface Story<T> {
16
+ (args: T): TemplateResult
17
+ args?: Partial<T>
18
+ argTypes?: Record<string, unknown>
19
+ }
20
+
21
+ interface ArgTypes {
22
+ placeholder?: string
23
+ name?: string
24
+ value?: object | string
25
+ slot?: TemplateResult
26
+ }
27
+
28
+ const Template: Story<ArgTypes> = ({ placeholder = 'Checkbox', name = 'hello', value = '', slot }: ArgTypes) => html`
29
+ <link href="/themes/app-theme.css" rel="stylesheet" />
30
+ <link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet" />
31
+
32
+ <ox-select
33
+ name=${name}
34
+ @change=${(e: Event) => {
35
+ console.log((e.target as HTMLInputElement).value)
36
+ }}
37
+ placeholder=${placeholder}
38
+ .value=${value}
39
+ >
40
+ ${slot}
41
+ </ox-select>
42
+ `
43
+
44
+ export const Regular = Template.bind({})
45
+ Regular.args = {
46
+ placeholder: 'single select',
47
+ name: 'label',
48
+ value: '',
49
+ slot: html`
50
+ <ox-popup-list align-left nowrap>
51
+ <div option value="A">LABEL-A</div>
52
+ <div option value="B">LABEL-B</div>
53
+ <div option value="C">LABEL-C</div>
54
+ <div option value="TOO LONG VALUE">LABEL-TOO LONG VALUE</div>
55
+ </ox-popup-list>
56
+ `
57
+ }
58
+
59
+ export const MultipleSelect = Template.bind({})
60
+ MultipleSelect.args = {
61
+ placeholder: 'multiple select',
62
+ name: 'multiple',
63
+ value: ['B', 'TOO LONG VALUE'],
64
+ slot: html`
65
+ <ox-popup-list multiple with-search>
66
+ <div option value="A">A</div>
67
+ <div option value="B">B</div>
68
+ <div option value="C">C</div>
69
+ <div option value="TOO LONG VALUE" />TOO LONG VALUE</div>
70
+ </ox-popup-list>
71
+ `
72
+ }
73
+
74
+ export const MultipleWithCheckbox = Template.bind({})
75
+ MultipleWithCheckbox.args = {
76
+ placeholder: 'multiple with checkbox',
77
+ name: 'multiple',
78
+ value: ['B', 'C', 'F'],
79
+ slot: html`
80
+ <ox-popup-list attr-selected="checked" multiple with-search>
81
+ <ox-checkbox
82
+ option
83
+ @change=${(e: Event) => {
84
+ const target = e.target as HTMLInputElement
85
+ const options = target.parentElement!.querySelectorAll('[option]')
86
+ console.log(options)
87
+ options.forEach(option => ((option as HTMLInputElement).checked = target.checked))
88
+ }}
89
+ >set all</ox-checkbox
90
+ >
91
+ <ox-checkbox option value="A">LABEL-A</ox-checkbox>
92
+ <ox-checkbox option value="B">LABEL-B</ox-checkbox>
93
+ <ox-checkbox option value="C" checked>LABEL-C</ox-checkbox>
94
+ <ox-checkbox option value="D">LABEL-D</ox-checkbox>
95
+ <ox-checkbox option value="E">LABEL-E</ox-checkbox>
96
+ <ox-checkbox option value="F">LABEL-F</ox-checkbox>
97
+ <ox-checkbox option value="G">LABEL-G</ox-checkbox>
98
+ <ox-checkbox option value="TOO LONG VALUE">TOO LONG VALUE</ox-checkbox>
99
+ </ox-popup-list>
100
+ `
101
+ }
@@ -0,0 +1,142 @@
1
+ body {
2
+ /* theme color */
3
+ --primary-color-rgb: 56, 162, 91;
4
+ --primary-color: rgb(var(--primary-color-rgb));
5
+ --secondary-color-rgb: 71, 97, 114;
6
+ --secondary-color: rgb(var(--secondary-color-rgb));
7
+ --focus-color: var(--theme-white-color);
8
+ --primary-background-color: var(--secondary-color);
9
+ --secondary-background-color: #183936;
10
+ --main-section-background-color: #f7f6f4;
11
+ --theme-white-color: #fff;
12
+ --theme-black-color: rgba(0, 0, 0, 0.9);
13
+
14
+ --focus-background-color: var(--primary-color);
15
+ --primary-text-color: var(--theme-black-color);
16
+ --secondary-text-color: #218f62;
17
+
18
+ --opacity-dark-color: rgba(0, 0, 0, 0.4);
19
+ --opacity-light-color: rgba(255, 255, 255, 0.8);
20
+
21
+ /* status color */
22
+ --status-success-color: #35a24a;
23
+ --status-warning-color: #ee8d03;
24
+ --status-danger-color: #d14946;
25
+ --status-info-color: #398ace;
26
+
27
+ /* common style */
28
+ --border-radius: 4px;
29
+ --border-dark-color: 1px solid rgba(0, 0, 0, 0.15);
30
+ --border-light-color: 1px solid rgba(255, 255, 255, 0.3);
31
+
32
+ --box-shadow: 2px 2px 3px 0px rgba(0, 0, 0, 0.1);
33
+
34
+ --theme-font: 'Noto', Helvetica;
35
+
36
+ --margin-default: 9px;
37
+ --margin-narrow: 4px;
38
+ --margin-wide: 15px;
39
+ --padding-default: var(--margin-default);
40
+ --padding-narrow: var(--margin-narrow);
41
+ --padding-wide: var(--margin-wide);
42
+
43
+ --scrollbar-thumb-color: rgba(57, 78, 100, 0.5);
44
+ --scrollbar-thumb-hover-color: var(--primary-color);
45
+
46
+ --fontsize-default: 14px;
47
+ --fontsize-small: 13px;
48
+ --fontsize-large: 16px;
49
+
50
+ /* app layout style */
51
+ --app-grid-template-area: 'header header header' 'nav main aside' 'nav footer aside';
52
+
53
+ /* title & description style */
54
+ --title-margin: var(--margin-narrow) 0;
55
+ --title-font: bold 24px var(--theme-font);
56
+ --title-text-color: var(--secondary-color);
57
+ --title-font-mobile: bold 20px var(--theme-font);
58
+
59
+ --page-description-margin: var(--margin-narrow) 0 var(--margin-wide) 0;
60
+ --page-description-font: normal var(--fontsize-default) / 1.2rem var(--theme-font);
61
+ --page-description-color: var(--secondary-text-color);
62
+
63
+ --subtitle-padding: 12px 5px 3px 5px;
64
+ --subtitle-font: bold 18px var(--theme-font);
65
+ --subtitle-text-color: var(--primary-color);
66
+ --subtitle-border-bottom: 1px solid var(--primary-color);
67
+
68
+ /* icon style */
69
+ --icon-tiny-size: 24px;
70
+ --icon-default-size: 36px;
71
+ --icon-big-size: 48px;
72
+ --icon-default-color: var(--theme-white-color);
73
+
74
+ /* material design component themes */
75
+ --mdc-theme-on-primary: var(--theme-white-color);
76
+ --mdc-theme-primary: var(--secondary-text-color);
77
+ --mdc-theme-on-secondary: var(--theme-white-color);
78
+ --mdc-theme-secondary: var(--primary-color);
79
+ --mdc-button-outline-color: var(--primary-color);
80
+ --mdc-danger-button-primary-color: var(--status-danger-color);
81
+ --mdc-danger-button-outline-color: var(--status-danger-color);
82
+ --mdc-button-outline-width: 1px;
83
+ --mdc-button-horizontal-padding: 16px;
84
+
85
+ /* button style */
86
+ --button-background-color: #fafbfc;
87
+ --button-background-focus-color: var(--primary-color);
88
+ --button-border: var(--border-dark-color);
89
+ --button-border-radius: var(--border-radius);
90
+ --button-margin: var(--margin-default) var(--margin-default) var(--margin-default) 0;
91
+ --button-padding: var(--padding-default);
92
+ --button-color: var(--secondary-color);
93
+ --button-font: normal 15px var(--theme-font);
94
+ --button-text-transform: capitalize;
95
+ --button-active-box-shadow: 1px 1px 1px 0px rgba(0, 0, 0, 0.2);
96
+ --button-activ-border: 1px solid var(--primary-color);
97
+
98
+ --button-primary-background-color: var(--primary-color);
99
+ --button-primary-active-background-color: var(--status-success-color);
100
+ --button-primary-padding: var(--margin-default) var(--margin-wide);
101
+ --button-primary-color: var(--theme-white-color);
102
+ --button-primary-font: bold 16px var(--theme-font);
103
+
104
+ /* table style */
105
+ --th-padding: var(--padding-default) 0 var(--padding-default) var(--padding-default);
106
+ --th-border-top: 2px solid var(--secondary-color);
107
+ --th-text-transform: capitalize;
108
+ --th-font: bold var(--fontsize-small) var(--theme-font);
109
+ --th-color: rgba(var(--secondary-color-rgb), 0.8);
110
+
111
+ --tr-background-color: var(--theme-white-color);
112
+ --tr-background-odd-color: rgba(255, 255, 255, 0.4);
113
+ --tr-background-hover-color: #e1f5fe;
114
+ --td-border-bottom: 1px solid rgba(0, 0, 0, 0.09);
115
+ --td-padding: var(--padding-default);
116
+ --td-font: normal 13px var(--theme-font);
117
+ --td-color: var(--secondary-color);
118
+
119
+ /* form style */
120
+ --label-font: normal var(--fontsize-default) var(--theme-font);
121
+ --label-color: var(--secondary-color);
122
+ --label-text-transform: capitalize;
123
+ --input-margin: var(--margin-narrow) 0;
124
+ --input-padding: var(--padding-default);
125
+ --input-min-width: 200px;
126
+ --input-font: normal var(--fontsize-default) var(--theme-font);
127
+ --input-hint-font: normal var(--fontsize-small) var(--theme-font);
128
+ --input-hint-color: #666;
129
+ --input-container-max-width: 900px;
130
+ --fieldset-margin: var(--padding-wide) 0;
131
+ --fieldset-padding: 0 var(--padding-wide) var(--padding-wide) var(--padding-wide);
132
+ --legend-padding: var(--padding-default) 0;
133
+ --legend-color: var(--secondary-text-color);
134
+ --legend-font: bold 16px var(--theme-font);
135
+ }
136
+
137
+ @media only screen and (max-width: 460px) {
138
+ body {
139
+ /* subtitle style */
140
+ --subtitle-margin: 0;
141
+ }
142
+ }