@operato/input 9.0.0-beta.7 → 9.0.0-beta.85
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 +249 -0
- package/dist/src/index.d.ts +0 -3
- package/dist/src/index.js +0 -3
- package/dist/src/index.js.map +1 -1
- package/dist/src/ox-form-field.d.ts +2 -5
- package/dist/src/ox-form-field.js +2 -5
- package/dist/src/ox-form-field.js.map +1 -1
- package/dist/src/ox-input-angle.js +1 -3
- package/dist/src/ox-input-angle.js.map +1 -1
- package/dist/src/ox-input-background-pattern.d.ts +36 -0
- package/dist/src/ox-input-background-pattern.js +114 -0
- package/dist/src/ox-input-background-pattern.js.map +1 -0
- package/dist/src/ox-input-color-gradient.d.ts +12 -10
- package/dist/src/ox-input-color-gradient.js +104 -222
- package/dist/src/ox-input-color-gradient.js.map +1 -1
- package/dist/src/ox-input-color-stops.d.ts +26 -22
- package/dist/src/ox-input-color-stops.js +122 -151
- package/dist/src/ox-input-color-stops.js.map +1 -1
- package/dist/src/ox-input-color.d.ts +13 -5
- package/dist/src/ox-input-color.js +169 -96
- package/dist/src/ox-input-color.js.map +1 -1
- package/dist/src/ox-input-crontab.js +1 -0
- package/dist/src/ox-input-crontab.js.map +1 -1
- package/dist/src/ox-input-direction.js +1 -0
- package/dist/src/ox-input-direction.js.map +1 -1
- package/dist/src/ox-input-duration.js +4 -0
- package/dist/src/ox-input-duration.js.map +1 -1
- package/dist/src/ox-input-fill-style.d.ts +48 -0
- package/dist/src/ox-input-fill-style.js +330 -0
- package/dist/src/ox-input-fill-style.js.map +1 -0
- package/dist/src/ox-input-multiple-colors.js +2 -2
- package/dist/src/ox-input-multiple-colors.js.map +1 -1
- package/dist/src/ox-input-options.js +0 -1
- package/dist/src/ox-input-options.js.map +1 -1
- package/dist/src/ox-input-privilege.js +1 -0
- package/dist/src/ox-input-privilege.js.map +1 -1
- package/dist/src/ox-input-range.js +2 -0
- package/dist/src/ox-input-range.js.map +1 -1
- package/dist/src/ox-input-select-buttons.d.ts +1 -1
- package/dist/src/ox-input-select-buttons.js +2 -2
- package/dist/src/ox-input-select-buttons.js.map +1 -1
- package/dist/src/ox-input-table.d.ts +20 -2
- package/dist/src/ox-input-table.js +67 -160
- package/dist/src/ox-input-table.js.map +1 -1
- package/dist/src/ox-input-unit-number.js +2 -1
- package/dist/src/ox-input-unit-number.js.map +1 -1
- package/dist/src/ox-input-value-map.js +7 -3
- package/dist/src/ox-input-value-map.js.map +1 -1
- package/dist/src/ox-select-floor.js +1 -0
- package/dist/src/ox-select-floor.js.map +1 -1
- package/dist/src/ox-select.d.ts +3 -0
- package/dist/src/ox-select.js +19 -9
- package/dist/src/ox-select.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +31 -25
- package/dist/stories/image-for-select-floor.d.ts +0 -1
- package/dist/stories/image-for-select-floor.js +0 -2
- package/dist/stories/image-for-select-floor.js.map +0 -1
- package/dist/stories/ox-buttons-radio.stories.d.ts +0 -26
- package/dist/stories/ox-buttons-radio.stories.js +0 -75
- package/dist/stories/ox-buttons-radio.stories.js.map +0 -1
- package/dist/stories/ox-checkbox.stories.d.ts +0 -44
- package/dist/stories/ox-checkbox.stories.js +0 -84
- package/dist/stories/ox-checkbox.stories.js.map +0 -1
- package/dist/stories/ox-input-3axis.stories.d.ts +0 -26
- package/dist/stories/ox-input-3axis.stories.js +0 -63
- package/dist/stories/ox-input-3axis.stories.js.map +0 -1
- package/dist/stories/ox-input-3dish.stories.d.ts +0 -30
- package/dist/stories/ox-input-3dish.stories.js +0 -91
- package/dist/stories/ox-input-3dish.stories.js.map +0 -1
- package/dist/stories/ox-input-angle.stories.d.ts +0 -30
- package/dist/stories/ox-input-angle.stories.js +0 -69
- package/dist/stories/ox-input-angle.stories.js.map +0 -1
- package/dist/stories/ox-input-barcode.stories.d.ts +0 -47
- package/dist/stories/ox-input-barcode.stories.js +0 -89
- package/dist/stories/ox-input-barcode.stories.js.map +0 -1
- package/dist/stories/ox-input-code.stories.d.ts +0 -38
- package/dist/stories/ox-input-code.stories.js +0 -76
- package/dist/stories/ox-input-code.stories.js.map +0 -1
- package/dist/stories/ox-input-crontab.stories.d.ts +0 -29
- package/dist/stories/ox-input-crontab.stories.js +0 -67
- package/dist/stories/ox-input-crontab.stories.js.map +0 -1
- package/dist/stories/ox-input-data.stories.d.ts +0 -29
- package/dist/stories/ox-input-data.stories.js +0 -67
- package/dist/stories/ox-input-data.stories.js.map +0 -1
- package/dist/stories/ox-input-direction.stories.d.ts +0 -29
- package/dist/stories/ox-input-direction.stories.js +0 -76
- package/dist/stories/ox-input-direction.stories.js.map +0 -1
- package/dist/stories/ox-input-duration.stories.d.ts +0 -30
- package/dist/stories/ox-input-duration.stories.js +0 -69
- package/dist/stories/ox-input-duration.stories.js.map +0 -1
- package/dist/stories/ox-input-file.stories.d.ts +0 -53
- package/dist/stories/ox-input-file.stories.js +0 -80
- package/dist/stories/ox-input-file.stories.js.map +0 -1
- package/dist/stories/ox-input-hashtags.stories.d.ts +0 -33
- package/dist/stories/ox-input-hashtags.stories.js +0 -66
- package/dist/stories/ox-input-hashtags.stories.js.map +0 -1
- package/dist/stories/ox-input-i18n-label.stories.d.ts +0 -29
- package/dist/stories/ox-input-i18n-label.stories.js +0 -88
- package/dist/stories/ox-input-i18n-label.stories.js.map +0 -1
- package/dist/stories/ox-input-key-values.stories.d.ts +0 -33
- package/dist/stories/ox-input-key-values.stories.js +0 -81
- package/dist/stories/ox-input-key-values.stories.js.map +0 -1
- package/dist/stories/ox-input-mass-fraction.stories.d.ts +0 -37
- package/dist/stories/ox-input-mass-fraction.stories.js +0 -79
- package/dist/stories/ox-input-mass-fraction.stories.js.map +0 -1
- package/dist/stories/ox-input-multiple-colors.stories.d.ts +0 -24
- package/dist/stories/ox-input-multiple-colors.stories.js +0 -59
- package/dist/stories/ox-input-multiple-colors.stories.js.map +0 -1
- package/dist/stories/ox-input-options.stories.d.ts +0 -29
- package/dist/stories/ox-input-options.stories.js +0 -65
- package/dist/stories/ox-input-options.stories.js.map +0 -1
- package/dist/stories/ox-input-partition-keys.stories.d.ts +0 -29
- package/dist/stories/ox-input-partition-keys.stories.js +0 -69
- package/dist/stories/ox-input-partition-keys.stories.js.map +0 -1
- package/dist/stories/ox-input-privilege.stories.d.ts +0 -40
- package/dist/stories/ox-input-privilege.stories.js +0 -87
- package/dist/stories/ox-input-privilege.stories.js.map +0 -1
- package/dist/stories/ox-input-quantifier.stories.d.ts +0 -29
- package/dist/stories/ox-input-quantifier.stories.js +0 -63
- package/dist/stories/ox-input-quantifier.stories.js.map +0 -1
- package/dist/stories/ox-input-range.stories.d.ts +0 -41
- package/dist/stories/ox-input-range.stories.js +0 -64
- package/dist/stories/ox-input-range.stories.js.map +0 -1
- package/dist/stories/ox-input-search.stories.d.ts +0 -36
- package/dist/stories/ox-input-search.stories.js +0 -68
- package/dist/stories/ox-input-search.stories.js.map +0 -1
- package/dist/stories/ox-input-select-buttons.stories.d.ts +0 -38
- package/dist/stories/ox-input-select-buttons.stories.js +0 -94
- package/dist/stories/ox-input-select-buttons.stories.js.map +0 -1
- package/dist/stories/ox-input-signature.stories.d.ts +0 -25
- package/dist/stories/ox-input-signature.stories.js +0 -60
- package/dist/stories/ox-input-signature.stories.js.map +0 -1
- package/dist/stories/ox-input-switch.stories.d.ts +0 -38
- package/dist/stories/ox-input-switch.stories.js +0 -68
- package/dist/stories/ox-input-switch.stories.js.map +0 -1
- package/dist/stories/ox-input-table-column-config.stories.d.ts +0 -29
- package/dist/stories/ox-input-table-column-config.stories.js +0 -94
- package/dist/stories/ox-input-table-column-config.stories.js.map +0 -1
- package/dist/stories/ox-input-unit.stories.d.ts +0 -42
- package/dist/stories/ox-input-unit.stories.js +0 -123
- package/dist/stories/ox-input-unit.stories.js.map +0 -1
- package/dist/stories/ox-input-value-map.stories.d.ts +0 -39
- package/dist/stories/ox-input-value-map.stories.js +0 -69
- package/dist/stories/ox-input-value-map.stories.js.map +0 -1
- package/dist/stories/ox-input-value-ranges.stories.d.ts +0 -39
- package/dist/stories/ox-input-value-ranges.stories.js +0 -69
- package/dist/stories/ox-input-value-ranges.stories.js.map +0 -1
- package/dist/stories/ox-input-work-shift.stories.d.ts +0 -30
- package/dist/stories/ox-input-work-shift.stories.js +0 -91
- package/dist/stories/ox-input-work-shift.stories.js.map +0 -1
- package/dist/stories/ox-select-floor.stories.d.ts +0 -45
- package/dist/stories/ox-select-floor.stories.js +0 -166
- package/dist/stories/ox-select-floor.stories.js.map +0 -1
- package/dist/stories/ox-select-set-options.stories.d.ts +0 -48
- package/dist/stories/ox-select-set-options.stories.js +0 -178
- package/dist/stories/ox-select-set-options.stories.js.map +0 -1
- package/dist/stories/ox-select.stories.d.ts +0 -34
- package/dist/stories/ox-select.stories.js +0 -151
- package/dist/stories/ox-select.stories.js.map +0 -1
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import '../src/ox-select-floor.js';
|
|
2
|
-
import { html } from 'lit';
|
|
3
|
-
import { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles.js';
|
|
4
|
-
import { IMAGE } from './image-for-select-floor.js';
|
|
5
|
-
export default {
|
|
6
|
-
title: 'ox-select-floor',
|
|
7
|
-
component: 'ox-select-floor',
|
|
8
|
-
argTypes: {
|
|
9
|
-
disabled: { control: 'boolean' },
|
|
10
|
-
value: { control: 'text' },
|
|
11
|
-
bottomLimit: { control: 'number' },
|
|
12
|
-
perspective: { control: 'number' },
|
|
13
|
-
rotateX: { control: 'number' },
|
|
14
|
-
rotateXForActive: { control: 'number' },
|
|
15
|
-
interval: { control: 'number' }
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
const cards = new Array(10).fill({}).map((_, index) => {
|
|
19
|
-
return {
|
|
20
|
-
image: IMAGE,
|
|
21
|
-
name: index + 1 + '층'
|
|
22
|
-
};
|
|
23
|
-
});
|
|
24
|
-
const Template = ({ value, disabled, bottomLimit = 70, perspective = 1200, rotateX = 60, rotateXForActive = 40, interval = 0 }) => html `
|
|
25
|
-
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet" />
|
|
26
|
-
|
|
27
|
-
<link href="/themes/light.css" rel="stylesheet" />
|
|
28
|
-
<link href="/themes/dark.css" rel="stylesheet" />
|
|
29
|
-
<link href="/themes/spacing.css" rel="stylesheet" />
|
|
30
|
-
|
|
31
|
-
<link
|
|
32
|
-
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
|
|
33
|
-
rel="stylesheet"
|
|
34
|
-
/>
|
|
35
|
-
<link
|
|
36
|
-
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
|
|
37
|
-
rel="stylesheet"
|
|
38
|
-
/>
|
|
39
|
-
<link
|
|
40
|
-
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
|
|
41
|
-
rel="stylesheet"
|
|
42
|
-
/>
|
|
43
|
-
|
|
44
|
-
<style>
|
|
45
|
-
${MDTypeScaleStyles.cssText}
|
|
46
|
-
</style>
|
|
47
|
-
|
|
48
|
-
<style>
|
|
49
|
-
html,
|
|
50
|
-
body {
|
|
51
|
-
margin: 0;
|
|
52
|
-
padding: 0;
|
|
53
|
-
overflow: hidden;
|
|
54
|
-
|
|
55
|
-
overscroll-behavior-y: none;
|
|
56
|
-
|
|
57
|
-
/* This is a font-stack that tries to use the system-default sans-serifs first */
|
|
58
|
-
font-family: Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
|
|
59
|
-
line-height: 1.5;
|
|
60
|
-
-webkit-font-smoothing: antialiased;
|
|
61
|
-
|
|
62
|
-
accent-color: var(--md-sys-color-primary);
|
|
63
|
-
background-color: var(--md-sys-color-background);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.container {
|
|
67
|
-
height: 1000px;
|
|
68
|
-
text-align: center;
|
|
69
|
-
padding: 20px;
|
|
70
|
-
|
|
71
|
-
background-color: var(--md-sys-color-primary-container);
|
|
72
|
-
color: var(--md-sys-color-on-primary-container);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
div[status] {
|
|
76
|
-
display: flex;
|
|
77
|
-
position: absolute;
|
|
78
|
-
right: 0px;
|
|
79
|
-
bottom: 0px;
|
|
80
|
-
align-items: center;
|
|
81
|
-
right: 3%;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
div[status] > div[content] {
|
|
85
|
-
display: flex;
|
|
86
|
-
background-color: #4e5055;
|
|
87
|
-
color: #fff;
|
|
88
|
-
padding: 5px 7px;
|
|
89
|
-
border-radius: 7px;
|
|
90
|
-
gap: 10px;
|
|
91
|
-
font-size: 14px;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
div[status] span {
|
|
95
|
-
display: flex;
|
|
96
|
-
align-items: center;
|
|
97
|
-
width: 48px;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
div[status] md-icon {
|
|
101
|
-
width: 20px;
|
|
102
|
-
height: 20px;
|
|
103
|
-
margin-right: 4px;
|
|
104
|
-
border-radius: 5px;
|
|
105
|
-
font-size: 21px;
|
|
106
|
-
font-weight: 700;
|
|
107
|
-
}
|
|
108
|
-
div[status] md-icon[request] {
|
|
109
|
-
background-color: #f7f7f7;
|
|
110
|
-
color: #4e5055;
|
|
111
|
-
}
|
|
112
|
-
div[status] md-icon[pass] {
|
|
113
|
-
background-color: #4bbb4a;
|
|
114
|
-
}
|
|
115
|
-
div[status] md-icon[fail] {
|
|
116
|
-
background-color: #ff4444;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
span[name] {
|
|
120
|
-
width: 40px;
|
|
121
|
-
color: #4e5055;
|
|
122
|
-
margin-left: 6px;
|
|
123
|
-
text-align: center;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
span[name][active] {
|
|
127
|
-
color: var(--md-sys-color-on-error);
|
|
128
|
-
background-color: var(--md-sys-color-error);
|
|
129
|
-
border-radius: 999px;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
ox-select-floor {
|
|
133
|
-
--ox-select-floor-rotate-x: ${rotateX}deg;
|
|
134
|
-
--ox-select-floor-rotate-x-active: ${rotateXForActive}deg;
|
|
135
|
-
--ox-select-floor-perspective: ${perspective}px;
|
|
136
|
-
}
|
|
137
|
-
</style>
|
|
138
|
-
|
|
139
|
-
<div class="container md-typescale-body-large-prominent">
|
|
140
|
-
<ox-select-floor
|
|
141
|
-
.cards=${cards}
|
|
142
|
-
.bottomLimit=${bottomLimit}
|
|
143
|
-
?disabled=${disabled}
|
|
144
|
-
.interval=${interval}
|
|
145
|
-
@change=${(e) => console.log(e.target.value)}
|
|
146
|
-
>
|
|
147
|
-
${cards.map(({ image, name }, index) => html `<div slot="template-${index}" status>
|
|
148
|
-
<div content>
|
|
149
|
-
<span><md-icon request slot="icon">exclamation</md-icon>100</span>
|
|
150
|
-
<span><md-icon pass slot="icon">check</md-icon>50</span>
|
|
151
|
-
<span><md-icon fail slot="icon">close</md-icon>5</span>
|
|
152
|
-
</div>
|
|
153
|
-
<span name>${name}</span>
|
|
154
|
-
</div>`)}
|
|
155
|
-
</ox-select-floor>
|
|
156
|
-
</div>
|
|
157
|
-
`;
|
|
158
|
-
export const Regular = Template.bind({});
|
|
159
|
-
Regular.args = {
|
|
160
|
-
bottomLimit: 70,
|
|
161
|
-
perspective: 1200,
|
|
162
|
-
rotateX: 60,
|
|
163
|
-
rotateXForActive: 40,
|
|
164
|
-
interval: 0
|
|
165
|
-
};
|
|
166
|
-
//# sourceMappingURL=ox-select-floor.stories.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ox-select-floor.stories.js","sourceRoot":"","sources":["../../stories/ox-select-floor.stories.ts"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAA;AAElC,OAAO,EAAE,IAAI,EAAkB,M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A,gBAAgB;uCACpB,WAAW;;;;;;eAMnC,KAAK;qBACC,WAAW;kBACd,QAAQ;kBACR,QAAQ;gBACV,CAAC,CAAQ,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAG,CAAiB,CAAC,MAAe,CAAC,KAAK,CAAC;;QAE5E,KAAK,CAAC,GAAG,CACT,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,CACzB,IAAI,CAAA,uBAAuB,KAAK;;;;;;yBAMjB,IAAI;iBACZ,CACV;;;CAGN,CAAA;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACxC,OAAO,CAAC,IAAI,GAAG;IACb,WAAW,EAAE,EAAE;IACf,WAAW,EAAE,IAAI;IACjB,OAAO,EAAE,EAAE;IACX,gBAAgB,EAAE,EAAE;IACpB,QAAQ,EAAE,CAAC;CACZ,CAAA","sourcesContent":["import '../src/ox-select-floor.js'\n\nimport { html, TemplateResult } from 'lit'\nimport { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles.js'\nimport { IMAGE } from './image-for-select-floor.js'\n\nexport default {\n title: 'ox-select-floor',\n component: 'ox-select-floor',\n argTypes: {\n disabled: { control: 'boolean' },\n value: { control: 'text' },\n bottomLimit: { control: 'number' },\n perspective: { control: 'number' },\n rotateX: { control: 'number' },\n rotateXForActive: { control: 'number' },\n interval: { control: 'number' }\n }\n}\n\ninterface Story<T> {\n (args: T): TemplateResult\n args?: Partial<T>\n argTypes?: Record<string, unknown>\n}\n\ninterface ArgTypes {\n value?: string\n bottomLimit?: number\n perspective?: number\n rotateX?: number\n rotateXForActive?: number\n disabled?: boolean\n interval?: number\n}\n\nconst cards = new Array(10).fill({}).map((_, index) => {\n return {\n image: IMAGE,\n name: index + 1 + '층'\n }\n})\n\nconst Template: Story<ArgTypes> = ({\n value,\n disabled,\n bottomLimit = 70,\n perspective = 1200,\n rotateX = 60,\n rotateXForActive = 40,\n interval = 0\n}: ArgTypes) => html`\n <link href=\"https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap\" rel=\"stylesheet\" />\n\n <link href=\"/themes/light.css\" rel=\"stylesheet\" />\n <link href=\"/themes/dark.css\" rel=\"stylesheet\" />\n <link href=\"/themes/spacing.css\" rel=\"stylesheet\" />\n\n <link\n href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1\"\n rel=\"stylesheet\"\n />\n <link\n href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1\"\n rel=\"stylesheet\"\n />\n <link\n href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1\"\n rel=\"stylesheet\"\n />\n\n <style>\n ${MDTypeScaleStyles.cssText}\n </style>\n\n <style>\n html,\n body {\n margin: 0;\n padding: 0;\n overflow: hidden;\n\n overscroll-behavior-y: none;\n\n /* This is a font-stack that tries to use the system-default sans-serifs first */\n font-family: Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';\n line-height: 1.5;\n -webkit-font-smoothing: antialiased;\n\n accent-color: var(--md-sys-color-primary);\n background-color: var(--md-sys-color-background);\n }\n\n .container {\n height: 1000px;\n text-align: center;\n padding: 20px;\n\n background-color: var(--md-sys-color-primary-container);\n color: var(--md-sys-color-on-primary-container);\n }\n\n div[status] {\n display: flex;\n position: absolute;\n right: 0px;\n bottom: 0px;\n align-items: center;\n right: 3%;\n }\n\n div[status] > div[content] {\n display: flex;\n background-color: #4e5055;\n color: #fff;\n padding: 5px 7px;\n border-radius: 7px;\n gap: 10px;\n font-size: 14px;\n }\n\n div[status] span {\n display: flex;\n align-items: center;\n width: 48px;\n }\n\n div[status] md-icon {\n width: 20px;\n height: 20px;\n margin-right: 4px;\n border-radius: 5px;\n font-size: 21px;\n font-weight: 700;\n }\n div[status] md-icon[request] {\n background-color: #f7f7f7;\n color: #4e5055;\n }\n div[status] md-icon[pass] {\n background-color: #4bbb4a;\n }\n div[status] md-icon[fail] {\n background-color: #ff4444;\n }\n\n span[name] {\n width: 40px;\n color: #4e5055;\n margin-left: 6px;\n text-align: center;\n }\n\n span[name][active] {\n color: var(--md-sys-color-on-error);\n background-color: var(--md-sys-color-error);\n border-radius: 999px;\n }\n\n ox-select-floor {\n --ox-select-floor-rotate-x: ${rotateX}deg;\n --ox-select-floor-rotate-x-active: ${rotateXForActive}deg;\n --ox-select-floor-perspective: ${perspective}px;\n }\n </style>\n\n <div class=\"container md-typescale-body-large-prominent\">\n <ox-select-floor\n .cards=${cards}\n .bottomLimit=${bottomLimit}\n ?disabled=${disabled}\n .interval=${interval}\n @change=${(e: Event) => console.log(((e as CustomEvent).target as any)!.value)}\n >\n ${cards.map(\n ({ image, name }, index) =>\n html`<div slot=\"template-${index}\" status>\n <div content>\n <span><md-icon request slot=\"icon\">exclamation</md-icon>100</span>\n <span><md-icon pass slot=\"icon\">check</md-icon>50</span>\n <span><md-icon fail slot=\"icon\">close</md-icon>5</span>\n </div>\n <span name>${name}</span>\n </div>`\n )}\n </ox-select-floor>\n </div>\n`\n\nexport const Regular = Template.bind({})\nRegular.args = {\n bottomLimit: 70,\n perspective: 1200,\n rotateX: 60,\n rotateXForActive: 40,\n interval: 0\n}\n"]}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import '../src/ox-select.js';
|
|
2
|
-
import '../src/ox-checkbox.js';
|
|
3
|
-
import { TemplateResult } from 'lit';
|
|
4
|
-
declare const _default: {
|
|
5
|
-
title: string;
|
|
6
|
-
component: string;
|
|
7
|
-
argTypes: {
|
|
8
|
-
placeholder: {
|
|
9
|
-
control: string;
|
|
10
|
-
};
|
|
11
|
-
name: {
|
|
12
|
-
control: string;
|
|
13
|
-
};
|
|
14
|
-
options: {
|
|
15
|
-
control: string;
|
|
16
|
-
};
|
|
17
|
-
multiple: {
|
|
18
|
-
control: string;
|
|
19
|
-
};
|
|
20
|
-
withSearch: {
|
|
21
|
-
control: string;
|
|
22
|
-
};
|
|
23
|
-
disabled: {
|
|
24
|
-
control: string;
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
export default _default;
|
|
29
|
-
interface Story<T> {
|
|
30
|
-
(args: T): TemplateResult;
|
|
31
|
-
args?: Partial<T>;
|
|
32
|
-
argTypes?: Record<string, unknown>;
|
|
33
|
-
}
|
|
34
|
-
interface ArgTypes {
|
|
35
|
-
placeholder?: string;
|
|
36
|
-
name?: string;
|
|
37
|
-
value?: object | string;
|
|
38
|
-
options?: string[] | {
|
|
39
|
-
display: string;
|
|
40
|
-
value: string;
|
|
41
|
-
}[];
|
|
42
|
-
multiple?: boolean;
|
|
43
|
-
withSearch?: boolean;
|
|
44
|
-
disabled?: boolean;
|
|
45
|
-
}
|
|
46
|
-
export declare const Regular: Story<ArgTypes>;
|
|
47
|
-
export declare const MultipleSelect: Story<ArgTypes>;
|
|
48
|
-
export declare const MultipleWithCheckbox: Story<ArgTypes>;
|
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
import '../src/ox-select.js';
|
|
2
|
-
import '../src/ox-checkbox.js';
|
|
3
|
-
import { html } from 'lit';
|
|
4
|
-
import { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles.js';
|
|
5
|
-
export default {
|
|
6
|
-
title: 'ox-select-set-options',
|
|
7
|
-
component: 'ox-select',
|
|
8
|
-
argTypes: {
|
|
9
|
-
placeholder: { control: 'text' },
|
|
10
|
-
name: { control: 'text' },
|
|
11
|
-
options: { control: 'object' },
|
|
12
|
-
multiple: { control: 'boolean' },
|
|
13
|
-
withSearch: { control: 'boolean' },
|
|
14
|
-
disabled: { control: 'boolean' }
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
const Template = ({ placeholder = 'Checkbox', name = 'hello', value = '', options = [], multiple, withSearch, disabled }) => html `
|
|
18
|
-
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet" />
|
|
19
|
-
|
|
20
|
-
<link href="/themes/light.css" rel="stylesheet" />
|
|
21
|
-
<link href="/themes/dark.css" rel="stylesheet" />
|
|
22
|
-
<link href="/themes/spacing.css" rel="stylesheet" />
|
|
23
|
-
|
|
24
|
-
<link
|
|
25
|
-
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
|
|
26
|
-
rel="stylesheet"
|
|
27
|
-
/>
|
|
28
|
-
<link
|
|
29
|
-
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
|
|
30
|
-
rel="stylesheet"
|
|
31
|
-
/>
|
|
32
|
-
<link
|
|
33
|
-
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
|
|
34
|
-
rel="stylesheet"
|
|
35
|
-
/>
|
|
36
|
-
|
|
37
|
-
<style>
|
|
38
|
-
${MDTypeScaleStyles.cssText}
|
|
39
|
-
</style>
|
|
40
|
-
|
|
41
|
-
<style>
|
|
42
|
-
.container {
|
|
43
|
-
height: 500px;
|
|
44
|
-
text-align: center;
|
|
45
|
-
padding: 20px;
|
|
46
|
-
|
|
47
|
-
background-color: var(--md-sys-color-primary-container);
|
|
48
|
-
color: var(--md-sys-color-on-primary-container);
|
|
49
|
-
}
|
|
50
|
-
</style>
|
|
51
|
-
|
|
52
|
-
<div class="container md-typescale-body-large-prominent">
|
|
53
|
-
<ox-select
|
|
54
|
-
name=${name}
|
|
55
|
-
@change=${(e) => {
|
|
56
|
-
console.log(e.target.value);
|
|
57
|
-
}}
|
|
58
|
-
placeholder=${placeholder}
|
|
59
|
-
.value=${value}
|
|
60
|
-
?disabled=${disabled}
|
|
61
|
-
>
|
|
62
|
-
</ox-select>
|
|
63
|
-
|
|
64
|
-
<input
|
|
65
|
-
type="button"
|
|
66
|
-
value="set options"
|
|
67
|
-
@click=${() => {
|
|
68
|
-
const select = document.querySelector('ox-select');
|
|
69
|
-
select.setOptions(options, { multiple, withSearch });
|
|
70
|
-
select.value = JSON.parse(JSON.stringify(value));
|
|
71
|
-
}}
|
|
72
|
-
/>
|
|
73
|
-
</div>
|
|
74
|
-
`;
|
|
75
|
-
export const Regular = Template.bind({});
|
|
76
|
-
Regular.args = {
|
|
77
|
-
placeholder: 'single select',
|
|
78
|
-
name: 'label',
|
|
79
|
-
value: '',
|
|
80
|
-
multiple: false,
|
|
81
|
-
options: [
|
|
82
|
-
{
|
|
83
|
-
value: 'A',
|
|
84
|
-
display: 'LABEL-A'
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
value: 'B',
|
|
88
|
-
display: 'LABEL-B'
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
value: 'C',
|
|
92
|
-
display: 'LABEL-C'
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
value: 'TOO LONG VALUE',
|
|
96
|
-
display: 'LABEL-TOO LONG VALUE'
|
|
97
|
-
}
|
|
98
|
-
]
|
|
99
|
-
};
|
|
100
|
-
export const MultipleSelect = Template.bind({});
|
|
101
|
-
MultipleSelect.args = {
|
|
102
|
-
placeholder: 'multiple select',
|
|
103
|
-
name: 'multiple',
|
|
104
|
-
multiple: true,
|
|
105
|
-
withSearch: true,
|
|
106
|
-
value: ['B', 'TOO LONG VALUE'],
|
|
107
|
-
options: [
|
|
108
|
-
'A',
|
|
109
|
-
'B',
|
|
110
|
-
'C',
|
|
111
|
-
'D',
|
|
112
|
-
'E',
|
|
113
|
-
'F',
|
|
114
|
-
'G',
|
|
115
|
-
'H',
|
|
116
|
-
'I',
|
|
117
|
-
'J',
|
|
118
|
-
'K',
|
|
119
|
-
'L',
|
|
120
|
-
'M',
|
|
121
|
-
'O',
|
|
122
|
-
'P',
|
|
123
|
-
'Q',
|
|
124
|
-
'R',
|
|
125
|
-
'S',
|
|
126
|
-
'T',
|
|
127
|
-
'U',
|
|
128
|
-
'V',
|
|
129
|
-
'W',
|
|
130
|
-
'X',
|
|
131
|
-
'Y',
|
|
132
|
-
'Z',
|
|
133
|
-
'TOO LONG VALUE'
|
|
134
|
-
]
|
|
135
|
-
};
|
|
136
|
-
export const MultipleWithCheckbox = Template.bind({});
|
|
137
|
-
MultipleWithCheckbox.args = {
|
|
138
|
-
placeholder: 'multiple with checkbox',
|
|
139
|
-
name: 'multiple',
|
|
140
|
-
multiple: true,
|
|
141
|
-
withSearch: true,
|
|
142
|
-
value: ['B', 'C', 'F'],
|
|
143
|
-
options: [
|
|
144
|
-
{
|
|
145
|
-
value: 'A',
|
|
146
|
-
display: 'A'
|
|
147
|
-
},
|
|
148
|
-
{
|
|
149
|
-
value: 'B',
|
|
150
|
-
display: 'B'
|
|
151
|
-
},
|
|
152
|
-
{
|
|
153
|
-
value: 'C',
|
|
154
|
-
display: 'C'
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
value: 'D',
|
|
158
|
-
display: 'D'
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
value: 'E',
|
|
162
|
-
display: 'E'
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
value: 'F',
|
|
166
|
-
display: 'F'
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
value: 'G',
|
|
170
|
-
display: 'G'
|
|
171
|
-
},
|
|
172
|
-
{
|
|
173
|
-
value: 'TOO LONG VALUE',
|
|
174
|
-
display: 'TOO LONG VALUE'
|
|
175
|
-
}
|
|
176
|
-
]
|
|
177
|
-
};
|
|
178
|
-
//# sourceMappingURL=ox-select-set-options.stories.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ox-select-set-options.stories.js","sourceRoot":"","sources":["../../stories/ox-select-set-options.stories.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAA;AAC5B,OAAO,uBAAuB,CAAA;AAG9B,OAAO,EAAE,IAAI,EAAkB,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UAAU,EAAE,IAAI;IAChB,KAAK,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;IACtB,OAAO,EAAE;QACP;YACE,KAAK,EAAE,GAAG;YACV,OAAO,EAAE,GAAG;SACb;QACD;YACE,KAAK,EAAE,GAAG;YACV,OAAO,EAAE,GAAG;SACb;QACD;YACE,KAAK,EAAE,GAAG;YACV,OAAO,EAAE,GAAG;SACb;QACD;YACE,KAAK,EAAE,GAAG;YACV,OAAO,EAAE,GAAG;SACb;QACD;YACE,KAAK,EAAE,GAAG;YACV,OAAO,EAAE,GAAG;SACb;QACD;YACE,KAAK,EAAE,GAAG;YACV,OAAO,EAAE,GAAG;SACb;QACD;YACE,KAAK,EAAE,GAAG;YACV,OAAO,EAAE,GAAG;SACb;QACD;YACE,KAAK,EAAE,gBAAgB;YACvB,OAAO,EAAE,gBAAgB;SAC1B;KACF;CACF,CAAA","sourcesContent":["import '../src/ox-select.js'\nimport '../src/ox-checkbox.js'\n\nimport { OxSelect } from '../src/ox-select.js'\nimport { html, TemplateResult } from 'lit'\nimport { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles.js'\n\nexport default {\n title: 'ox-select-set-options',\n component: 'ox-select',\n argTypes: {\n placeholder: { control: 'text' },\n name: { control: 'text' },\n options: { control: 'object' },\n multiple: { control: 'boolean' },\n withSearch: { control: 'boolean' },\n disabled: { control: 'boolean' }\n }\n}\n\ninterface Story<T> {\n (args: T): TemplateResult\n args?: Partial<T>\n argTypes?: Record<string, unknown>\n}\n\ninterface ArgTypes {\n placeholder?: string\n name?: string\n value?: object | string\n options?: string[] | { display: string; value: string }[]\n multiple?: boolean\n withSearch?: boolean\n disabled?: boolean\n}\n\nconst Template: Story<ArgTypes> = ({\n placeholder = 'Checkbox',\n name = 'hello',\n value = '',\n options = [],\n multiple,\n withSearch,\n disabled\n}: ArgTypes) => html`\n <link href=\"https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap\" rel=\"stylesheet\" />\n\n <link href=\"/themes/light.css\" rel=\"stylesheet\" />\n <link href=\"/themes/dark.css\" rel=\"stylesheet\" />\n <link href=\"/themes/spacing.css\" rel=\"stylesheet\" />\n\n <link\n href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1\"\n rel=\"stylesheet\"\n />\n <link\n href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1\"\n rel=\"stylesheet\"\n />\n <link\n href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1\"\n rel=\"stylesheet\"\n />\n\n <style>\n ${MDTypeScaleStyles.cssText}\n </style>\n\n <style>\n .container {\n height: 500px;\n text-align: center;\n padding: 20px;\n\n background-color: var(--md-sys-color-primary-container);\n color: var(--md-sys-color-on-primary-container);\n }\n </style>\n\n <div class=\"container md-typescale-body-large-prominent\">\n <ox-select\n name=${name}\n @change=${(e: Event) => {\n console.log((e.target as HTMLInputElement).value)\n }}\n placeholder=${placeholder}\n .value=${value}\n ?disabled=${disabled}\n >\n </ox-select>\n\n <input\n type=\"button\"\n value=\"set options\"\n @click=${() => {\n const select = document.querySelector('ox-select') as OxSelect\n select.setOptions(options, { multiple, withSearch })\n select.value = JSON.parse(JSON.stringify(value))\n }}\n />\n </div>\n`\n\nexport const Regular = Template.bind({})\nRegular.args = {\n placeholder: 'single select',\n name: 'label',\n value: '',\n multiple: false,\n options: [\n {\n value: 'A',\n display: 'LABEL-A'\n },\n {\n value: 'B',\n display: 'LABEL-B'\n },\n {\n value: 'C',\n display: 'LABEL-C'\n },\n {\n value: 'TOO LONG VALUE',\n display: 'LABEL-TOO LONG VALUE'\n }\n ]\n}\n\nexport const MultipleSelect = Template.bind({})\nMultipleSelect.args = {\n placeholder: 'multiple select',\n name: 'multiple',\n multiple: true,\n withSearch: true,\n value: ['B', 'TOO LONG VALUE'],\n options: [\n 'A',\n 'B',\n 'C',\n 'D',\n 'E',\n 'F',\n 'G',\n 'H',\n 'I',\n 'J',\n 'K',\n 'L',\n 'M',\n 'O',\n 'P',\n 'Q',\n 'R',\n 'S',\n 'T',\n 'U',\n 'V',\n 'W',\n 'X',\n 'Y',\n 'Z',\n 'TOO LONG VALUE'\n ]\n}\n\nexport const MultipleWithCheckbox = Template.bind({})\nMultipleWithCheckbox.args = {\n placeholder: 'multiple with checkbox',\n name: 'multiple',\n multiple: true,\n withSearch: true,\n value: ['B', 'C', 'F'],\n options: [\n {\n value: 'A',\n display: 'A'\n },\n {\n value: 'B',\n display: 'B'\n },\n {\n value: 'C',\n display: 'C'\n },\n {\n value: 'D',\n display: 'D'\n },\n {\n value: 'E',\n display: 'E'\n },\n {\n value: 'F',\n display: 'F'\n },\n {\n value: 'G',\n display: 'G'\n },\n {\n value: 'TOO LONG VALUE',\n display: 'TOO LONG VALUE'\n }\n ]\n}\n"]}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import '../src/ox-select.js';
|
|
2
|
-
import '../src/ox-checkbox.js';
|
|
3
|
-
import { TemplateResult } from 'lit';
|
|
4
|
-
declare const _default: {
|
|
5
|
-
title: string;
|
|
6
|
-
component: string;
|
|
7
|
-
argTypes: {
|
|
8
|
-
placeholder: {
|
|
9
|
-
control: string;
|
|
10
|
-
};
|
|
11
|
-
name: {
|
|
12
|
-
control: string;
|
|
13
|
-
};
|
|
14
|
-
disabled: {
|
|
15
|
-
control: string;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
export default _default;
|
|
20
|
-
interface Story<T> {
|
|
21
|
-
(args: T): TemplateResult;
|
|
22
|
-
args?: Partial<T>;
|
|
23
|
-
argTypes?: Record<string, unknown>;
|
|
24
|
-
}
|
|
25
|
-
interface ArgTypes {
|
|
26
|
-
placeholder?: string;
|
|
27
|
-
name?: string;
|
|
28
|
-
value?: object | string;
|
|
29
|
-
slot?: TemplateResult;
|
|
30
|
-
disabled?: boolean;
|
|
31
|
-
}
|
|
32
|
-
export declare const Regular: Story<ArgTypes>;
|
|
33
|
-
export declare const MultipleSelect: Story<ArgTypes>;
|
|
34
|
-
export declare const MultipleWithCheckbox: Story<ArgTypes>;
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
import '../src/ox-select.js';
|
|
2
|
-
import '../src/ox-checkbox.js';
|
|
3
|
-
import { html } from 'lit';
|
|
4
|
-
import { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles.js';
|
|
5
|
-
export default {
|
|
6
|
-
title: 'ox-select',
|
|
7
|
-
component: 'ox-select',
|
|
8
|
-
argTypes: {
|
|
9
|
-
placeholder: { control: 'text' },
|
|
10
|
-
name: { control: 'text' },
|
|
11
|
-
disabled: { control: 'boolean' }
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
const Template = ({ placeholder = 'Checkbox', name = 'hello', value = '', slot, disabled }) => html `
|
|
15
|
-
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet" />
|
|
16
|
-
|
|
17
|
-
<link href="/themes/light.css" rel="stylesheet" />
|
|
18
|
-
<link href="/themes/dark.css" rel="stylesheet" />
|
|
19
|
-
<link href="/themes/spacing.css" rel="stylesheet" />
|
|
20
|
-
|
|
21
|
-
<link
|
|
22
|
-
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
|
|
23
|
-
rel="stylesheet"
|
|
24
|
-
/>
|
|
25
|
-
<link
|
|
26
|
-
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
|
|
27
|
-
rel="stylesheet"
|
|
28
|
-
/>
|
|
29
|
-
<link
|
|
30
|
-
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
|
|
31
|
-
rel="stylesheet"
|
|
32
|
-
/>
|
|
33
|
-
|
|
34
|
-
<style>
|
|
35
|
-
${MDTypeScaleStyles.cssText}
|
|
36
|
-
</style>
|
|
37
|
-
|
|
38
|
-
<style>
|
|
39
|
-
.container {
|
|
40
|
-
height: 250px;
|
|
41
|
-
text-align: center;
|
|
42
|
-
padding: 20px;
|
|
43
|
-
|
|
44
|
-
background-color: var(--md-sys-color-primary-container);
|
|
45
|
-
color: var(--md-sys-color-on-primary-container);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
ox-select {
|
|
49
|
-
width: 300px;
|
|
50
|
-
}
|
|
51
|
-
</style>
|
|
52
|
-
|
|
53
|
-
<div class="container md-typescale-body-large-prominent">
|
|
54
|
-
<ox-select
|
|
55
|
-
name=${name}
|
|
56
|
-
@change=${(e) => {
|
|
57
|
-
console.log(e.target.value);
|
|
58
|
-
}}
|
|
59
|
-
placeholder=${placeholder}
|
|
60
|
-
.value=${value}
|
|
61
|
-
?disabled=${disabled}
|
|
62
|
-
>
|
|
63
|
-
${slot}
|
|
64
|
-
</ox-select>
|
|
65
|
-
</div>
|
|
66
|
-
`;
|
|
67
|
-
export const Regular = Template.bind({});
|
|
68
|
-
Regular.args = {
|
|
69
|
-
placeholder: 'single select',
|
|
70
|
-
name: 'label',
|
|
71
|
-
value: '',
|
|
72
|
-
slot: html `
|
|
73
|
-
<ox-popup-list align-left nowrap>
|
|
74
|
-
<div option value="A">LABEL-A</div>
|
|
75
|
-
<div option value="B">LABEL-B</div>
|
|
76
|
-
<div option value="C">LABEL-C</div>
|
|
77
|
-
<div option value="TOO LONG VALUE">LABEL-TOO LONG VALUE</div>
|
|
78
|
-
</ox-popup-list>
|
|
79
|
-
`
|
|
80
|
-
};
|
|
81
|
-
export const MultipleSelect = Template.bind({});
|
|
82
|
-
MultipleSelect.args = {
|
|
83
|
-
placeholder: 'multiple select',
|
|
84
|
-
name: 'multiple',
|
|
85
|
-
value: ['B', 'TOO LONG VALUE'],
|
|
86
|
-
slot: html `
|
|
87
|
-
<ox-popup-list multiple with-search>
|
|
88
|
-
<div option value="A">A</div>
|
|
89
|
-
<div option value="B">B</div>
|
|
90
|
-
<div option value="C">C</div>
|
|
91
|
-
<div option value="D">D</div>
|
|
92
|
-
<div option value="E">E</div>
|
|
93
|
-
<div option value="F">F</div>
|
|
94
|
-
<div option value="G">G</div>
|
|
95
|
-
<div option value="H">H</div>
|
|
96
|
-
<div option value="I">I</div>
|
|
97
|
-
<div option value="J">J</div>
|
|
98
|
-
<div option value="K">K</div>
|
|
99
|
-
<div option value="L">L</div>
|
|
100
|
-
<div option value="M">M</div>
|
|
101
|
-
<div option value="O">O</div>
|
|
102
|
-
<div option value="P">P</div>
|
|
103
|
-
<div option value="Q">Q</div>
|
|
104
|
-
<div option value="R">R</div>
|
|
105
|
-
<div option value="S">S</div>
|
|
106
|
-
<div option value="T">T</div>
|
|
107
|
-
<div option value="U">U</div>
|
|
108
|
-
<div option value="V">V</div>
|
|
109
|
-
<div option value="W">W</div>
|
|
110
|
-
<div option value="X">X</div>
|
|
111
|
-
<div option value="Y">Y</div>
|
|
112
|
-
<div option value="Z">Z</div>
|
|
113
|
-
<div option value="TOO LONG VALUE" />TOO LONG VALUE</div>
|
|
114
|
-
</ox-popup-list>
|
|
115
|
-
`
|
|
116
|
-
};
|
|
117
|
-
export const MultipleWithCheckbox = Template.bind({});
|
|
118
|
-
MultipleWithCheckbox.args = {
|
|
119
|
-
placeholder: 'multiple with checkbox',
|
|
120
|
-
name: 'multiple',
|
|
121
|
-
value: ['B', 'C', 'F'],
|
|
122
|
-
slot: html `
|
|
123
|
-
<ox-popup-list attr-selected="checked" multiple with-search>
|
|
124
|
-
<ox-checkbox
|
|
125
|
-
@change=${(e) => {
|
|
126
|
-
const target = e.target;
|
|
127
|
-
const options = Array.from(target.parentElement.querySelectorAll('[option]')).filter(option => !option.hasAttribute('hidden'));
|
|
128
|
-
options.forEach(option => (option.checked = target.checked));
|
|
129
|
-
const value = options
|
|
130
|
-
.map(option => (option.checked ? option.value : undefined))
|
|
131
|
-
.filter(Boolean);
|
|
132
|
-
target.closest('ox-popup-list').dispatchEvent(new CustomEvent('select', {
|
|
133
|
-
bubbles: true,
|
|
134
|
-
composed: true,
|
|
135
|
-
detail: value
|
|
136
|
-
}));
|
|
137
|
-
}}
|
|
138
|
-
>set all</ox-checkbox
|
|
139
|
-
>
|
|
140
|
-
<ox-checkbox option value="A">LABEL-A</ox-checkbox>
|
|
141
|
-
<ox-checkbox option value="B">LABEL-B</ox-checkbox>
|
|
142
|
-
<ox-checkbox option value="C" checked>LABEL-C</ox-checkbox>
|
|
143
|
-
<ox-checkbox option value="D">LABEL-D</ox-checkbox>
|
|
144
|
-
<ox-checkbox option value="E">LABEL-E</ox-checkbox>
|
|
145
|
-
<ox-checkbox option value="F">LABEL-F</ox-checkbox>
|
|
146
|
-
<ox-checkbox option value="G">LABEL-G</ox-checkbox>
|
|
147
|
-
<ox-checkbox option value="TOO LONG VALUE">TOO LONG VALUE</ox-checkbox>
|
|
148
|
-
</ox-popup-list>
|
|
149
|
-
`
|
|
150
|
-
};
|
|
151
|
-
//# sourceMappingURL=ox-select.stories.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ox-select.stories.js","sourceRoot":"","sources":["../../stories/ox-select.stories.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAA;AAC5B,OAAO,uBAAuB,CAAA;AAE9B,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAC1C,OAAO,EAAE,MAAM,IAAI,iBAAiB,EAAE,MAAM,iDAAiD,CAAA;AAE7F,eAAe;IACb,KAAK,EAAE,WAAW;IAClB,SAAS,EAAE,WAAW;IACtB,QAAQ,EAAE;QACR,WAAW,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;QAChC,IAAI,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;QACzB,QAAQ,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;KACjC;CACF,CAAA;AAgBD,MAAM,QAAQ,GAAoB,CAAC,EACjC,WAAW,GAA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CAAC,MAA0B,CAAA;QAC3C,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,aAAc,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CACnF,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CACzC,CAAA;QACD,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAE,MAA2B,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAA;QAClF,MAAM,KAAK,GAAG,OAAO;aAClB,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAE,MAA2B,CAAC,OAAO,CAAC,CAAC,CAAE,MAA2B,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;aACtG,MAAM,CAAC,OAAO,CAAC,CAEjB;QAAC,MAAM,CAAC,OAAO,CAAC,eAAe,CAAU,CAAC,aAAa,CACtD,IAAI,WAAW,CAAC,QAAQ,EAAE;YACxB,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;YACd,MAAM,EAAE,KAAK;SACd,CAAC,CACH,CAAA;IACH,CAAC;;;;;;;;;;;;GAYN;CACF,CAAA","sourcesContent":["import '../src/ox-select.js'\nimport '../src/ox-checkbox.js'\n\nimport { html, TemplateResult } from 'lit'\nimport { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles.js'\n\nexport default {\n title: 'ox-select',\n component: 'ox-select',\n argTypes: {\n placeholder: { control: 'text' },\n name: { control: 'text' },\n disabled: { control: 'boolean' }\n }\n}\n\ninterface Story<T> {\n (args: T): TemplateResult\n args?: Partial<T>\n argTypes?: Record<string, unknown>\n}\n\ninterface ArgTypes {\n placeholder?: string\n name?: string\n value?: object | string\n slot?: TemplateResult\n disabled?: boolean\n}\n\nconst Template: Story<ArgTypes> = ({\n placeholder = 'Checkbox',\n name = 'hello',\n value = '',\n slot,\n disabled\n}: ArgTypes) => html`\n <link href=\"https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap\" rel=\"stylesheet\" />\n\n <link href=\"/themes/light.css\" rel=\"stylesheet\" />\n <link href=\"/themes/dark.css\" rel=\"stylesheet\" />\n <link href=\"/themes/spacing.css\" rel=\"stylesheet\" />\n\n <link\n href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1\"\n rel=\"stylesheet\"\n />\n <link\n href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1\"\n rel=\"stylesheet\"\n />\n <link\n href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1\"\n rel=\"stylesheet\"\n />\n\n <style>\n ${MDTypeScaleStyles.cssText}\n </style>\n\n <style>\n .container {\n height: 250px;\n text-align: center;\n padding: 20px;\n\n background-color: var(--md-sys-color-primary-container);\n color: var(--md-sys-color-on-primary-container);\n }\n\n ox-select {\n width: 300px;\n }\n </style>\n\n <div class=\"container md-typescale-body-large-prominent\">\n <ox-select\n name=${name}\n @change=${(e: Event) => {\n console.log((e.target as HTMLInputElement).value)\n }}\n placeholder=${placeholder}\n .value=${value}\n ?disabled=${disabled}\n >\n ${slot}\n </ox-select>\n </div>\n`\n\nexport const Regular = Template.bind({})\nRegular.args = {\n placeholder: 'single select',\n name: 'label',\n value: '',\n slot: html`\n <ox-popup-list align-left nowrap>\n <div option value=\"A\">LABEL-A</div>\n <div option value=\"B\">LABEL-B</div>\n <div option value=\"C\">LABEL-C</div>\n <div option value=\"TOO LONG VALUE\">LABEL-TOO LONG VALUE</div>\n </ox-popup-list>\n `\n}\n\nexport const MultipleSelect = Template.bind({})\nMultipleSelect.args = {\n placeholder: 'multiple select',\n name: 'multiple',\n value: ['B', 'TOO LONG VALUE'],\n slot: html`\n <ox-popup-list multiple with-search>\n <div option value=\"A\">A</div>\n <div option value=\"B\">B</div>\n <div option value=\"C\">C</div>\n <div option value=\"D\">D</div>\n <div option value=\"E\">E</div>\n <div option value=\"F\">F</div>\n <div option value=\"G\">G</div>\n <div option value=\"H\">H</div>\n <div option value=\"I\">I</div>\n <div option value=\"J\">J</div>\n <div option value=\"K\">K</div>\n <div option value=\"L\">L</div>\n <div option value=\"M\">M</div>\n <div option value=\"O\">O</div>\n <div option value=\"P\">P</div>\n <div option value=\"Q\">Q</div>\n <div option value=\"R\">R</div>\n <div option value=\"S\">S</div>\n <div option value=\"T\">T</div>\n <div option value=\"U\">U</div>\n <div option value=\"V\">V</div>\n <div option value=\"W\">W</div>\n <div option value=\"X\">X</div>\n <div option value=\"Y\">Y</div>\n <div option value=\"Z\">Z</div>\n <div option value=\"TOO LONG VALUE\" />TOO LONG VALUE</div>\n </ox-popup-list>\n `\n}\n\nexport const MultipleWithCheckbox = Template.bind({})\nMultipleWithCheckbox.args = {\n placeholder: 'multiple with checkbox',\n name: 'multiple',\n value: ['B', 'C', 'F'],\n slot: html`\n <ox-popup-list attr-selected=\"checked\" multiple with-search>\n <ox-checkbox\n @change=${(e: Event) => {\n const target = e.target as HTMLInputElement\n const options = Array.from(target.parentElement!.querySelectorAll('[option]')).filter(\n option => !option.hasAttribute('hidden')\n )\n options.forEach(option => ((option as HTMLInputElement).checked = target.checked))\n const value = options\n .map(option => ((option as HTMLInputElement).checked ? (option as HTMLInputElement).value : undefined))\n .filter(Boolean)\n\n ;(target.closest('ox-popup-list') as any)!.dispatchEvent(\n new CustomEvent('select', {\n bubbles: true,\n composed: true,\n detail: value\n })\n )\n }}\n >set all</ox-checkbox\n >\n <ox-checkbox option value=\"A\">LABEL-A</ox-checkbox>\n <ox-checkbox option value=\"B\">LABEL-B</ox-checkbox>\n <ox-checkbox option value=\"C\" checked>LABEL-C</ox-checkbox>\n <ox-checkbox option value=\"D\">LABEL-D</ox-checkbox>\n <ox-checkbox option value=\"E\">LABEL-E</ox-checkbox>\n <ox-checkbox option value=\"F\">LABEL-F</ox-checkbox>\n <ox-checkbox option value=\"G\">LABEL-G</ox-checkbox>\n <ox-checkbox option value=\"TOO LONG VALUE\">TOO LONG VALUE</ox-checkbox>\n </ox-popup-list>\n `\n}\n"]}
|