@operato/attribute 2.0.0-alpha.13 → 2.0.0-alpha.131

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 (29) hide show
  1. package/CHANGELOG.md +647 -0
  2. package/dist/src/grist-editor/ox-grist-editor-attributes.d.ts +1 -1
  3. package/dist/src/grist-editor/ox-popup-attributes.d.ts +2 -1
  4. package/dist/src/grist-editor/ox-popup-attributes.js +7 -8
  5. package/dist/src/grist-editor/ox-popup-attributes.js.map +1 -1
  6. package/dist/src/ox-attribute-form.d.ts +1 -1
  7. package/dist/src/ox-attribute-form.js +2 -2
  8. package/dist/src/ox-attribute-form.js.map +1 -1
  9. package/dist/src/ox-attribute-view.d.ts +1 -1
  10. package/dist/src/ox-attribute-view.js +2 -2
  11. package/dist/src/ox-attribute-view.js.map +1 -1
  12. package/dist/stories/ox-attribute-form.stories.d.ts +1 -1
  13. package/dist/stories/ox-attribute-form.stories.js +25 -13
  14. package/dist/stories/ox-attribute-form.stories.js.map +1 -1
  15. package/dist/stories/ox-attribute-view.stories.d.ts +1 -1
  16. package/dist/stories/ox-attribute-view.stories.js +21 -9
  17. package/dist/stories/ox-attribute-view.stories.js.map +1 -1
  18. package/dist/stories/ox-grist-editor-attributes.stories.d.ts +1 -1
  19. package/dist/stories/ox-grist-editor-attributes.stories.js +66 -54
  20. package/dist/stories/ox-grist-editor-attributes.stories.js.map +1 -1
  21. package/dist/tsconfig.tsbuildinfo +1 -1
  22. package/package.json +24 -26
  23. package/src/grist-editor/ox-popup-attributes.ts +7 -8
  24. package/src/ox-attribute-form.ts +11 -8
  25. package/src/ox-attribute-view.ts +2 -2
  26. package/stories/ox-attribute-form.stories.ts +29 -18
  27. package/stories/ox-attribute-view.stories.ts +22 -11
  28. package/stories/ox-grist-editor-attributes.stories.ts +67 -56
  29. package/themes/grist-theme.css +2 -0
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@operato/attribute",
3
3
  "description": "WebApplication attribute supporting components following open-wc recommendations",
4
4
  "author": "heartyoh",
5
- "version": "2.0.0-alpha.13",
5
+ "version": "2.0.0-alpha.131",
6
6
  "main": "dist/src/index.js",
7
7
  "module": "dist/src/index.js",
8
8
  "exports": {
@@ -55,37 +55,35 @@
55
55
  "storybook:build": "tsc && npm run analyze -- --exclude dist && build-storybook"
56
56
  },
57
57
  "dependencies": {
58
- "@material/mwc-button": "^0.27.0",
59
- "@material/mwc-icon": "^0.27.0",
60
- "@material/mwc-icon-button": "^0.27.0",
61
- "@operato/data-grist": "^2.0.0-alpha.13",
62
- "@operato/graphql": "^2.0.0-alpha.0",
63
- "@operato/grist-editor": "^2.0.0-alpha.13",
64
- "@operato/i18n": "^2.0.0-alpha.0",
65
- "@operato/input": "^2.0.0-alpha.13",
66
- "@operato/popup": "^2.0.0-alpha.9",
67
- "@operato/property-editor": "^2.0.0-alpha.13",
68
- "@operato/shell": "^2.0.0-alpha.8",
69
- "@operato/styles": "^2.0.0-alpha.0",
70
- "@operato/utils": "^2.0.0-alpha.8",
71
- "lit": "^2.5.0"
58
+ "@material/web": "^1.4.0",
59
+ "@operato/data-grist": "^2.0.0-alpha.131",
60
+ "@operato/graphql": "^2.0.0-alpha.111",
61
+ "@operato/grist-editor": "^2.0.0-alpha.131",
62
+ "@operato/i18n": "^2.0.0-alpha.111",
63
+ "@operato/input": "^2.0.0-alpha.129",
64
+ "@operato/popup": "^2.0.0-alpha.129",
65
+ "@operato/property-editor": "^2.0.0-alpha.131",
66
+ "@operato/shell": "^2.0.0-alpha.129",
67
+ "@operato/styles": "^2.0.0-alpha.129",
68
+ "@operato/utils": "^2.0.0-alpha.122",
69
+ "lit": "^3.1.2"
72
70
  },
73
71
  "devDependencies": {
74
- "@custom-elements-manifest/analyzer": "^0.8.1",
72
+ "@custom-elements-manifest/analyzer": "^0.9.2",
75
73
  "@hatiolab/prettier-config": "^1.0.0",
76
- "@open-wc/eslint-config": "^10.0.0",
74
+ "@open-wc/eslint-config": "^12.0.3",
77
75
  "@open-wc/testing": "^3.1.6",
78
- "@typescript-eslint/eslint-plugin": "^5.59.1",
79
- "@typescript-eslint/parser": "^5.59.1",
76
+ "@typescript-eslint/eslint-plugin": "^7.0.1",
77
+ "@typescript-eslint/parser": "^7.0.1",
80
78
  "@web/dev-server": "^0.3.0",
81
- "@web/dev-server-storybook": "^0.7.4",
82
- "@web/test-runner": "^0.17.0",
79
+ "@web/dev-server-storybook": "^2.0.1",
80
+ "@web/test-runner": "^0.18.0",
83
81
  "concurrently": "^8.0.1",
84
82
  "eslint": "^8.39.0",
85
- "eslint-config-prettier": "^8.3.0",
86
- "husky": "^8.0.1",
87
- "lint-staged": "^13.2.2",
88
- "prettier": "^2.4.1",
83
+ "eslint-config-prettier": "^9.1.0",
84
+ "husky": "^9.0.11",
85
+ "lint-staged": "^15.2.2",
86
+ "prettier": "^3.2.5",
89
87
  "tslib": "^2.3.1",
90
88
  "typescript": "^5.0.4"
91
89
  },
@@ -102,5 +100,5 @@
102
100
  "prettier --write"
103
101
  ]
104
102
  },
105
- "gitHead": "112ec6a672e96837e01ffe55048f543fffa19e02"
103
+ "gitHead": "48271ff32be26111347ce27d120b238ae14e15ae"
106
104
  }
@@ -1,3 +1,4 @@
1
+ import '@material/web/icon/icon.js'
1
2
  import '../ox-attribute-form.js'
2
3
 
3
4
  import { css, html, LitElement } from 'lit'
@@ -5,13 +6,14 @@ import { customElement, property } from 'lit/decorators.js'
5
6
 
6
7
  import { i18next } from '@operato/i18n'
7
8
  import { closePopup } from '@operato/popup'
8
- import { ScrollbarStyles } from '@operato/styles'
9
+ import { ButtonContainerStyles, ScrollbarStyles } from '@operato/styles'
9
10
 
10
11
  import { AttributeSet } from '../types.js'
11
12
 
12
13
  @customElement('ox-popup-attributes')
13
14
  export class OxPopupAttributes extends LitElement {
14
15
  static styles = [
16
+ ButtonContainerStyles,
15
17
  ScrollbarStyles,
16
18
  css`
17
19
  :host {
@@ -39,11 +41,6 @@ export class OxPopupAttributes extends LitElement {
39
41
 
40
42
  color: var(--primary-color);
41
43
  }
42
-
43
- .button-container {
44
- display: flex;
45
- margin-left: auto;
46
- }
47
44
  `
48
45
  ]
49
46
 
@@ -59,8 +56,10 @@ export class OxPopupAttributes extends LitElement {
59
56
  </ox-attribute-form>
60
57
 
61
58
  <div class="button-container">
62
- <mwc-button @click=${this.onCancel.bind(this)}>${i18next.t('button.cancel')}</mwc-button>
63
- <mwc-button @click=${this.onConfirm.bind(this)}>${i18next.t('button.confirm')}</mwc-button>
59
+ <button @click=${this.onCancel.bind(this)} danger>
60
+ <md-icon>cancel</md-icon>${i18next.t('button.cancel')}
61
+ </button>
62
+ <button @click=${this.onConfirm.bind(this)}><md-icon>done</md-icon>${i18next.t('button.confirm')}</button>
64
63
  </div>
65
64
  `
66
65
  }
@@ -74,7 +74,7 @@ export class OxAttributeForm extends LitElement {
74
74
  vertical-align: middle;
75
75
  }
76
76
 
77
- div[description] mwc-icon {
77
+ div[description] md-icon {
78
78
  margin-top: -3px;
79
79
  font-size: 0.9rem;
80
80
  }
@@ -192,7 +192,7 @@ export class OxAttributeForm extends LitElement {
192
192
 
193
193
  return html` <label .title=${description}>
194
194
  <div name>${name}</div>
195
- <div description><mwc-icon>info_outline</mwc-icon> ${description}</div>
195
+ <div description><md-icon>info_outline</md-icon> ${description}</div>
196
196
  <div elements>${element}</div>
197
197
  </label>`
198
198
  })
@@ -201,14 +201,17 @@ export class OxAttributeForm extends LitElement {
201
201
  private buildValue() {
202
202
  const items = this.attributeSet!.items
203
203
 
204
- return (items || []).reduce((sum, item) => {
205
- const { tag, type } = item
204
+ return (items || []).reduce(
205
+ (sum, item) => {
206
+ const { tag, type } = item
206
207
 
207
- const editor = this.renderRoot.querySelector(`[name=${tag}]`) as HTMLInputElement
208
+ const editor = this.renderRoot.querySelector(`[name=${tag}]`) as HTMLInputElement
208
209
 
209
- sum[tag] = type === 'boolean' ? editor.checked : editor.value
210
+ sum[tag] = type === 'boolean' ? editor.checked : editor.value
210
211
 
211
- return sum
212
- }, {} as { [tag: string]: any })
212
+ return sum
213
+ },
214
+ {} as { [tag: string]: any }
215
+ )
213
216
  }
214
217
  }
@@ -81,7 +81,7 @@ export class OxAttributeView extends LitElement {
81
81
  vertical-align: middle;
82
82
  }
83
83
 
84
- div[description] mwc-icon {
84
+ div[description] md-icon {
85
85
  margin-top: -3px;
86
86
  font-size: 0.9rem;
87
87
  }
@@ -181,7 +181,7 @@ export class OxAttributeView extends LitElement {
181
181
 
182
182
  return html` <label .title=${description}>
183
183
  <div name>${name}</div>
184
- <div description><mwc-icon>info_outline</mwc-icon> ${description}</div>
184
+ <div description><md-icon>info_outline</md-icon> ${description}</div>
185
185
  <div elements>${element}</div>
186
186
  </label>`
187
187
  })
@@ -1,6 +1,6 @@
1
+ import '@material/web/icon/icon.js'
1
2
  import '@operato/i18n'
2
3
  import '../src/ox-attribute-form.js'
3
- import '@material/mwc-icon'
4
4
 
5
5
  import { html, TemplateResult } from 'lit'
6
6
 
@@ -71,24 +71,35 @@ var value = {
71
71
  credit: '최우수'
72
72
  }
73
73
 
74
- const Template: Story<ArgTypes> = ({}: ArgTypes) =>
75
- html`
76
- <link href="/themes/app-theme.css" rel="stylesheet" />
77
- <link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet" />
78
- <style>
79
- body {
80
- }
81
- </style>
74
+ const Template: Story<ArgTypes> = ({}: ArgTypes) => html`
75
+ <link href="/themes/app-theme.css" rel="stylesheet" />
76
+ <link
77
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
78
+ rel="stylesheet"
79
+ />
80
+ <link
81
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
82
+ rel="stylesheet"
83
+ />
84
+ <link
85
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
86
+ rel="stylesheet"
87
+ />
82
88
 
83
- <ox-attribute-form
84
- .attributeSet=${attributeSet}
85
- .value=${value}
86
- @change=${(e: CustomEvent) => {
87
- value = e.detail
88
- console.log('change', value)
89
- }}
90
- ></ox-attribute-form>
91
- `
89
+ <style>
90
+ body {
91
+ }
92
+ </style>
93
+
94
+ <ox-attribute-form
95
+ .attributeSet=${attributeSet}
96
+ .value=${value}
97
+ @change=${(e: CustomEvent) => {
98
+ value = e.detail
99
+ console.log('change', value)
100
+ }}
101
+ ></ox-attribute-form>
102
+ `
92
103
 
93
104
  export const Regular = Template.bind({})
94
105
  Regular.args = {}
@@ -1,6 +1,6 @@
1
1
  import '@operato/i18n'
2
2
  import '../src/ox-attribute-view.js'
3
- import '@material/mwc-icon'
3
+ import '@material/web/icon/icon.js'
4
4
 
5
5
  import { html, TemplateResult } from 'lit'
6
6
 
@@ -71,17 +71,28 @@ var value = {
71
71
  credit: '최우수'
72
72
  }
73
73
 
74
- const Template: Story<ArgTypes> = ({}: ArgTypes) =>
75
- html`
76
- <link href="/themes/app-theme.css" rel="stylesheet" />
77
- <link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet" />
78
- <style>
79
- body {
80
- }
81
- </style>
74
+ const Template: Story<ArgTypes> = ({}: ArgTypes) => html`
75
+ <link href="/themes/app-theme.css" rel="stylesheet" />
76
+ <link
77
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
78
+ rel="stylesheet"
79
+ />
80
+ <link
81
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
82
+ rel="stylesheet"
83
+ />
84
+ <link
85
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
86
+ rel="stylesheet"
87
+ />
82
88
 
83
- <ox-attribute-view .attributeSet=${attributeSet} .value=${value}></ox-attribute-view>
84
- `
89
+ <style>
90
+ body {
91
+ }
92
+ </style>
93
+
94
+ <ox-attribute-view .attributeSet=${attributeSet} .value=${value}></ox-attribute-view>
95
+ `
85
96
 
86
97
  export const Regular = Template.bind({})
87
98
  Regular.args = {}
@@ -1,4 +1,4 @@
1
- import '@material/mwc-icon'
1
+ import '@material/md-icon'
2
2
  import '@operato/property-editor/ox-property-editor-checkbox.js'
3
3
  import '@operato/property-editor/ox-property-editor-number.js'
4
4
  import '@operato/property-editor/ox-property-editor-string.js'
@@ -235,9 +235,9 @@ class GristDemo extends LitElement {
235
235
 
236
236
  <div slot="headroom" id="headroom">
237
237
  <div id="modes">
238
- <mwc-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>view_list</mwc-icon>
239
- <mwc-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>menu</mwc-icon>
240
- <mwc-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</mwc-icon>
238
+ <md-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>view_list</md-icon>
239
+ <md-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>menu</md-icon>
240
+ <md-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</md-icon>
241
241
  </div>
242
242
  </div>
243
243
  </ox-grist>
@@ -261,67 +261,78 @@ interface Story<T> {
261
261
 
262
262
  interface ArgTypes {}
263
263
 
264
- const Template: Story<ArgTypes> = ({}: ArgTypes) =>
265
- html`
266
- <link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet" />
267
- <link href="/themes/app-theme.css" rel="stylesheet" />
268
- <link href="/themes/oops-theme.css" rel="stylesheet" />
269
- <link href="/themes/grist-theme.css" rel="stylesheet" />
264
+ const Template: Story<ArgTypes> = ({}: ArgTypes) => html`
265
+ <link
266
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
267
+ rel="stylesheet"
268
+ />
269
+ <link
270
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
271
+ rel="stylesheet"
272
+ />
273
+ <link
274
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
275
+ rel="stylesheet"
276
+ />
270
277
 
271
- <style>
272
- [slot='headroom'] {
273
- display: flex;
274
- flex-direction: row;
275
- align-items: center;
276
- padding: var(--padding-default) var(--padding-wide);
277
- background-color: var(--theme-white-color);
278
- box-shadow: var(--box-shadow);
278
+ <link href="/themes/app-theme.css" rel="stylesheet" />
279
+ <link href="/themes/oops-theme.css" rel="stylesheet" />
280
+ <link href="/themes/grist-theme.css" rel="stylesheet" />
279
281
 
280
- --mdc-icon-size: 24px;
281
- }
282
- #sorters mwc-icon,
283
- #modes mwc-icon {
284
- --mdc-icon-size: 18px;
285
- }
286
- #sorters {
287
- margin-left: auto;
288
- margin-right: var(--margin-default);
289
- padding-left: var(--padding-narrow);
290
- border-bottom: var(--border-dark-color);
291
- position: relative;
292
- color: var(--secondary-color);
293
- font-size: var(--fontsize-default);
294
- user-select: none;
295
- }
282
+ <style>
283
+ [slot='headroom'] {
284
+ display: flex;
285
+ flex-direction: row;
286
+ align-items: center;
287
+ padding: var(--padding-default) var(--padding-wide);
288
+ background-color: var(--theme-white-color);
289
+ box-shadow: var(--box-shadow);
296
290
 
297
- #sorters > * {
298
- padding: var(--padding-narrow);
299
- vertical-align: middle;
300
- }
291
+ --md-icon-size: 24px;
292
+ }
293
+ #sorters md-icon,
294
+ #modes md-icon {
295
+ --md-icon-size: 18px;
296
+ }
297
+ #sorters {
298
+ margin-left: auto;
299
+ margin-right: var(--margin-default);
300
+ padding-left: var(--padding-narrow);
301
+ border-bottom: var(--border-dark-color);
302
+ position: relative;
303
+ color: var(--secondary-color);
304
+ font-size: var(--fontsize-default);
305
+ user-select: none;
306
+ }
301
307
 
302
- #filters {
303
- display: flex;
304
- justify-content: center;
305
- align-items: center;
306
- }
308
+ #sorters > * {
309
+ padding: var(--padding-narrow);
310
+ vertical-align: middle;
311
+ }
307
312
 
308
- #filters * {
309
- margin-right: var(--margin-default);
310
- }
313
+ #filters {
314
+ display: flex;
315
+ justify-content: center;
316
+ align-items: center;
317
+ }
311
318
 
312
- @media only screen and (max-width: 460px) {
313
- #filters {
314
- flex-direction: column;
315
- }
319
+ #filters * {
320
+ margin-right: var(--margin-default);
321
+ }
316
322
 
317
- #modes {
318
- display: none;
319
- }
323
+ @media only screen and (max-width: 460px) {
324
+ #filters {
325
+ flex-direction: column;
326
+ }
327
+
328
+ #modes {
329
+ display: none;
320
330
  }
321
- </style>
331
+ }
332
+ </style>
322
333
 
323
- <ox-attributes mode="LIST"></ox-attributes>
324
- `
334
+ <ox-attributes mode="LIST"></ox-attributes>
335
+ `
325
336
 
326
337
  export const Regular = Template.bind({})
327
338
  Regular.args = {}
@@ -35,6 +35,8 @@ body {
35
35
  --grid-header-filter-title-font: normal 12px var(--theme-font);
36
36
  --grid-header-filter-title-icon-color: var(--primary-color);
37
37
 
38
+ --grid-body-bottom-border: 1px solid rgba(var(--secondary-color-rgb), 0.2);
39
+
38
40
  --grid-record-background-color: var(--theme-white-color);
39
41
  --grid-record-odd-background-color: #f9f7f5;
40
42
  --grid-record-padding: 0 5px 0 5px;