@omegagrid/core 0.9.22 → 0.9.24

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.
@@ -1 +1 @@
1
- {"version":3,"file":"tmDark.d.ts","sourceRoot":"","sources":["../../../src/themes/definitions/tmDark.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;wBA2F/B,KAAK;AAzFV,wBAyFW"}
1
+ {"version":3,"file":"tmDark.d.ts","sourceRoot":"","sources":["../../../src/themes/definitions/tmDark.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;wBA4F/B,KAAK;AA1FV,wBA0FW"}
@@ -7,6 +7,7 @@ export default {
7
7
  'font-size': dom.numToPixels(constants.FONT_SIZE),
8
8
  'font-family': 'verdana',
9
9
  'base-radius': '3px',
10
+ 'base-shadow': '0 4px 10px rgba(0,0,0,0.6)',
10
11
  'button-color': 'var(--og-accent-color)',
11
12
  'button-background-color': '#1e1e1e',
12
13
  'button-background-color-highlight': '#3a3a3a',
@@ -58,20 +59,20 @@ export default {
58
59
  'bucket-top-background-color': '#181818',
59
60
  'bucket-sidebar-background-color': '#272727',
60
61
  'form-background-color': '#323233',
61
- 'colortype-yellow-background-color': '#655600',
62
- 'colortype-yellow-border-color': '#9b8100',
62
+ 'colortype-yellow-background-color': '#F9A825',
63
+ 'colortype-yellow-border-color': '#F9A825',
63
64
  'colortype-yellow-text-color': '#ffffff',
64
- 'colortype-green-background-color': '#015d00',
65
- 'colortype-green-border-color': '#00b420',
65
+ 'colortype-green-background-color': '#2E7D32',
66
+ 'colortype-green-border-color': '#2E7D32',
66
67
  'colortype-green-text-color': '#ffffff',
67
- 'colortype-red-background-color': '#730505',
68
- 'colortype-red-border-color': '#fb1515',
68
+ 'colortype-red-background-color': '#C62828',
69
+ 'colortype-red-border-color': '#C62828',
69
70
  'colortype-red-text-color': '#ffffff',
70
- 'colortype-blue-background-color': '#002265',
71
- 'colortype-blue-border-color': '#007cdc',
71
+ 'colortype-blue-background-color': '#1976D2',
72
+ 'colortype-blue-border-color': '#1976D2',
72
73
  'colortype-blue-text-color': '#ffffff',
73
- 'colortype-gray-background-color': '#434343',
74
- 'colortype-gray-border-color': '#6e6e6e',
74
+ 'colortype-gray-background-color': '#424242',
75
+ 'colortype-gray-border-color': '#424242',
75
76
  'colortype-gray-text-color': '#ffffff',
76
77
  'colortype-accent-text-color': '#ffffff',
77
78
  'switch-background-color': '#474747',
@@ -1 +1 @@
1
- {"version":3,"file":"tmDark.js","sourceRoot":"","sources":["../../../src/themes/definitions/tmDark.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGnC,eAAe;IACd,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,UAAU,EAAE;QACX,WAAW,EAAE,GAAG,CAAC,WAAW,CAAC,SAAS,CAAC,SAAS,CAAC;QACjD,aAAa,EAAE,SAAS;QACxB,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,wBAAwB;QACxC,yBAAyB,EAAE,SAAS;QACpC,mCAAmC,EAAE,SAAS;QAC9C,0BAA0B;QAC1B,kBAAkB,EAAE,SAAS;QAC7B,oBAAoB,EAAE,SAAS;QAC/B,oBAAoB,EAAE,SAAS;QAC/B,sBAAsB,EAAE,SAAS;QACjC,YAAY,EAAE,SAAS;QACvB,cAAc,EAAE,SAAS;QACzB,cAAc,EAAE,SAAS;QACzB,qBAAqB,EAAE,SAAS;QAChC,QAAQ,EAAE,SAAS;QACnB,cAAc,EAAE,SAAS;QACzB,gBAAgB,EAAE,SAAS;QAC3B,iBAAiB,EAAE,SAAS;QAC5B,aAAa,EAAE,mBAAmB;QAClC,kBAAkB,EAAE,SAAS;QAC7B,yBAAyB,EAAE,SAAS;QACpC,0BAA0B,EAAE,SAAS;QACrC,kBAAkB,EA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BAA6B,EAAE,SAAS;QAExC,yBAAyB,EAAE,SAAS;QACpC,qBAAqB,EAAE,SAAS;KAChC;CACQ,CAAC","sourcesContent":["import constants from '../../constants';\nimport { dom } from '../../common';\nimport { Theme } from '../../types';\n\nexport default {\n\tname: 'dark',\n\ttype: 'dark',\n\tdefinition: {\n\t\t'font-size': dom.numToPixels(constants.FONT_SIZE),\n\t\t'font-family': 'verdana',\n\t\t'base-radius': '3px',\n\t\t'button-color': 'var(--og-accent-color)',\n\t\t'button-background-color': '#1e1e1e',\n\t\t'button-background-color-highlight': '#3a3a3a',\n\t\t//'background': '#1e1e1e',\n\t\t'background-color': '#181818',\n\t\t'background-color-2': '#1f1f1f',\n\t\t'background-color-3': '#292929',\n\t\t'text-highlight-color': '#FFFF00',\n\t\t'text-color': '#9b9b9b',\n\t\t'text-color-2': '#ffffff',\n\t\t'text-color-3': '#ffffff',\n\t\t'text-color-reversed': '#ffffff',\n\t\t'border': '#3a3a3a',\n\t\t'border-color': '#3a3a3a',\n\t\t'border-color-2': '#2a2a2a',\n\t\t'cell-background': '#1e1e1e',\n\t\t'cell-border': '1px solid #3a3a3a',\n\t\t'hcell-background': '#2e2e2e',\n\t\t'slider-background-color': '#272727',\n\t\t'slider-background-active': '#313131',\n\t\t'slider-bar-color': '#494949',\n\t\t'slider-bar-active': '#494949',\n\t\t'expander-color': '#707070',\n\t\t'expander-hover': '#00955d',\n\t\t'expander-background-color': '#3F3F3F',\n\t\t'sizer-background': '#00955d',\n\t\t'frozen-border': '#000000',\n\t\t'inset-shadow-color': '#000000',\n\t\n\t\t'commands-color': '#ffffff',\n\t\t'commands-background': '#181818',\n\t\t'commands-header-background': '#363636',\n\t\t'commands-input-background': '#1D1D1D',\n\t\t'commands-shadow': '#151515',\n\t\n\t\t'dialog-color': '#ffffff',\n\t\t'dialog-background': '#181818',\n\t\t'dialog-header-background': '#363636',\n\t\t'dialog-shadow': '#151515',\n\t\t\n\t\t'tab-border-color': '#2a2a2a',\n\t\t'tab-background-color': '#181818',\n\t\t'tab-panel-background-color': '#181818',\n\t\t'tab-background-color-active': '#1f1f1f',\n\t\t\n\t\t'bucket-tab-background-color': '#2d2d2d',\n\t\t'bucket-tab-panel-background-color': '#252526',\n\t\t'bucket-tab-background-color-active': '#1f1f1f',\n\t\t'bucket-right-background-color': '#1e1e1e',\n\t\t'bucket-border-color': '#2a2a2a',\n\t\t'bucket-center-background-color': '#181818',\n\t\t'bucket-left-background-color': '#181818',\n\t\t'bucket-top-background-color': '#181818',\n\t\t'bucket-sidebar-background-color': '#272727',\n\t\t\n\t\t'form-background-color': '#323233',\n\t\n\t\t'colortype-yellow-background-color': '#655600',\n\t\t'colortype-yellow-border-color': '#9b8100',\n\t\t'colortype-yellow-text-color': '#ffffff',\n\t\n\t\t'colortype-green-background-color': '#015d00',\n\t\t'colortype-green-border-color': '#00b420',\n\t\t'colortype-green-text-color': '#ffffff',\n\t\n\t\t'colortype-red-background-color': '#730505',\n\t\t'colortype-red-border-color': '#fb1515',\n\t\t'colortype-red-text-color': '#ffffff',\n\t\n\t\t'colortype-blue-background-color': '#002265',\n\t\t'colortype-blue-border-color': '#007cdc',\n\t\t'colortype-blue-text-color': '#ffffff',\n\t\n\t\t'colortype-gray-background-color': '#434343',\n\t\t'colortype-gray-border-color': '#6e6e6e',\n\t\t'colortype-gray-text-color': '#ffffff',\n\t\n\t\t'colortype-accent-text-color': '#ffffff',\n\t\n\t\t'switch-background-color': '#474747',\n\t\t'switch-slider-color': '#ffffff',\n\t},\n} as Theme;"]}
1
+ {"version":3,"file":"tmDark.js","sourceRoot":"","sources":["../../../src/themes/definitions/tmDark.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGnC,eAAe;IACd,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,UAAU,EAAE;QACX,WAAW,EAAE,GAAG,CAAC,WAAW,CAAC,SA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C9C,oCAAoC,EAAE,SAAS;QAC/C,+BAA+B,EAAE,SAAS;QAC1C,qBAAqB,EAAE,SAAS;QAChC,gCAAgC,EAAE,SAAS;QAC3C,8BAA8B,EAAE,SAAS;QACzC,6BAA6B,EAAE,SAAS;QACxC,iCAAiC,EAAE,SAAS;QAE5C,uBAAuB,EAAE,SAAS;QAElC,mCAAmC,EAAE,SAAS;QAC9C,+BAA+B,EAAE,SAAS;QAC1C,6BAA6B,EAAE,SAAS;QAExC,kCAAkC,EAAE,SAAS;QAC7C,8BAA8B,EAAE,SAAS;QACzC,4BAA4B,EAAE,SAAS;QAEvC,gCAAgC,EAAE,SAAS;QAC3C,4BAA4B,EAAE,SAAS;QACvC,0BAA0B,EAAE,SAAS;QAErC,iCAAiC,EAAE,SAAS;QAC5C,6BAA6B,EAAE,SAAS;QACxC,2BAA2B,EAAE,SAAS;QAEtC,iCAAiC,EAAE,SAAS;QAC5C,6BAA6B,EAAE,SAAS;QACxC,2BAA2B,EAAE,SAAS;QAEtC,6BAA6B,EAAE,SAAS;QAExC,yBAAyB,EAAE,SAAS;QACpC,qBAAqB,EAAE,SAAS;KAChC;CACQ,CAAC","sourcesContent":["import constants from '../../constants';\nimport { dom } from '../../common';\nimport { Theme } from '../../types';\n\nexport default {\n\tname: 'dark',\n\ttype: 'dark',\n\tdefinition: {\n\t\t'font-size': dom.numToPixels(constants.FONT_SIZE),\n\t\t'font-family': 'verdana',\n\t\t'base-radius': '3px',\n\t\t'base-shadow': '0 4px 10px rgba(0,0,0,0.6)',\n\t\t'button-color': 'var(--og-accent-color)',\n\t\t'button-background-color': '#1e1e1e',\n\t\t'button-background-color-highlight': '#3a3a3a',\n\t\t//'background': '#1e1e1e',\n\t\t'background-color': '#181818',\n\t\t'background-color-2': '#1f1f1f',\n\t\t'background-color-3': '#292929',\n\t\t'text-highlight-color': '#FFFF00',\n\t\t'text-color': '#9b9b9b',\n\t\t'text-color-2': '#ffffff',\n\t\t'text-color-3': '#ffffff',\n\t\t'text-color-reversed': '#ffffff',\n\t\t'border': '#3a3a3a',\n\t\t'border-color': '#3a3a3a',\n\t\t'border-color-2': '#2a2a2a',\n\t\t'cell-background': '#1e1e1e',\n\t\t'cell-border': '1px solid #3a3a3a',\n\t\t'hcell-background': '#2e2e2e',\n\t\t'slider-background-color': '#272727',\n\t\t'slider-background-active': '#313131',\n\t\t'slider-bar-color': '#494949',\n\t\t'slider-bar-active': '#494949',\n\t\t'expander-color': '#707070',\n\t\t'expander-hover': '#00955d',\n\t\t'expander-background-color': '#3F3F3F',\n\t\t'sizer-background': '#00955d',\n\t\t'frozen-border': '#000000',\n\t\t'inset-shadow-color': '#000000',\n\t\n\t\t'commands-color': '#ffffff',\n\t\t'commands-background': '#181818',\n\t\t'commands-header-background': '#363636',\n\t\t'commands-input-background': '#1D1D1D',\n\t\t'commands-shadow': '#151515',\n\t\n\t\t'dialog-color': '#ffffff',\n\t\t'dialog-background': '#181818',\n\t\t'dialog-header-background': '#363636',\n\t\t'dialog-shadow': '#151515',\n\t\t\n\t\t'tab-border-color': '#2a2a2a',\n\t\t'tab-background-color': '#181818',\n\t\t'tab-panel-background-color': '#181818',\n\t\t'tab-background-color-active': '#1f1f1f',\n\t\t\n\t\t'bucket-tab-background-color': '#2d2d2d',\n\t\t'bucket-tab-panel-background-color': '#252526',\n\t\t'bucket-tab-background-color-active': '#1f1f1f',\n\t\t'bucket-right-background-color': '#1e1e1e',\n\t\t'bucket-border-color': '#2a2a2a',\n\t\t'bucket-center-background-color': '#181818',\n\t\t'bucket-left-background-color': '#181818',\n\t\t'bucket-top-background-color': '#181818',\n\t\t'bucket-sidebar-background-color': '#272727',\n\t\t\n\t\t'form-background-color': '#323233',\n\t\n\t\t'colortype-yellow-background-color': '#F9A825',\n\t\t'colortype-yellow-border-color': '#F9A825',\n\t\t'colortype-yellow-text-color': '#ffffff',\n\t\n\t\t'colortype-green-background-color': '#2E7D32',\n\t\t'colortype-green-border-color': '#2E7D32',\n\t\t'colortype-green-text-color': '#ffffff',\n\t\n\t\t'colortype-red-background-color': '#C62828',\n\t\t'colortype-red-border-color': '#C62828',\n\t\t'colortype-red-text-color': '#ffffff',\n\t\n\t\t'colortype-blue-background-color': '#1976D2',\n\t\t'colortype-blue-border-color': '#1976D2',\n\t\t'colortype-blue-text-color': '#ffffff',\n\t\n\t\t'colortype-gray-background-color': '#424242',\n\t\t'colortype-gray-border-color': '#424242',\n\t\t'colortype-gray-text-color': '#ffffff',\n\t\n\t\t'colortype-accent-text-color': '#ffffff',\n\t\n\t\t'switch-background-color': '#474747',\n\t\t'switch-slider-color': '#ffffff',\n\t},\n} as Theme;"]}
@@ -1 +1 @@
1
- {"version":3,"file":"tmLight.d.ts","sourceRoot":"","sources":["../../../src/themes/definitions/tmLight.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;wBA2F/B,KAAK;AAzFV,wBAyFW"}
1
+ {"version":3,"file":"tmLight.d.ts","sourceRoot":"","sources":["../../../src/themes/definitions/tmLight.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;wBA4F/B,KAAK;AA1FV,wBA0FW"}
@@ -7,6 +7,7 @@ export default {
7
7
  'font-size': dom.numToPixels(constants.FONT_SIZE),
8
8
  'font-family': 'verdana',
9
9
  'base-radius': '3px',
10
+ 'base-shadow': '0 4px 12px rgba(0, 0, 0, 0.12)',
10
11
  'button-color': 'var(--og-accent-color)',
11
12
  'button-background-color': '#ffffff',
12
13
  'button-background-color-highlight': '#cccccc',
@@ -58,21 +59,21 @@ export default {
58
59
  'bucket-top-background-color': '#e5e5e5',
59
60
  'bucket-sidebar-background-color': '#f3f3f3',
60
61
  'form-background-color': '#e5e5e5',
61
- 'colortype-yellow-background-color': '#e2d68d',
62
- 'colortype-yellow-border-color': '#9b8100',
63
- 'colortype-yellow-text-color': '#000000',
64
- 'colortype-green-background-color': '#7ecf7e',
65
- 'colortype-green-border-color': '#00b420',
66
- 'colortype-green-text-color': '#000000',
67
- 'colortype-red-background-color': '#ed8181',
68
- 'colortype-red-border-color': '#fb1515',
69
- 'colortype-red-text-color': '#000000',
70
- 'colortype-blue-background-color': '#88b0ff',
71
- 'colortype-blue-border-color': '#007cdc',
72
- 'colortype-blue-text-color': '#000000',
73
- 'colortype-gray-background-color': '#dadada',
74
- 'colortype-gray-border-color': '#cbcbcb',
75
- 'colortype-gray-text-color': '#000000',
62
+ 'colortype-yellow-background-color': '#FBC02D',
63
+ 'colortype-yellow-border-color': '#FBC02D',
64
+ 'colortype-yellow-text-color': '#424242',
65
+ 'colortype-green-background-color': '#43A047',
66
+ 'colortype-green-border-color': '#43A047',
67
+ 'colortype-green-text-color': '#FFFFFF',
68
+ 'colortype-red-background-color': '#EF5350',
69
+ 'colortype-red-border-color': '#EF5350',
70
+ 'colortype-red-text-color': '#FFFFFF',
71
+ 'colortype-blue-background-color': '#1E88E5',
72
+ 'colortype-blue-border-color': '#1E88E5',
73
+ 'colortype-blue-text-color': '#FFFFFF',
74
+ 'colortype-gray-background-color': '#D9D9D9',
75
+ 'colortype-gray-border-color': '#D9D9D9',
76
+ 'colortype-gray-text-color': '#212121',
76
77
  'colortype-accent-text-color': '#ffffff',
77
78
  'switch-background-color': '#cccccc',
78
79
  'switch-slider-color': '#ffffff',
@@ -1 +1 @@
1
- {"version":3,"file":"tmLight.js","sourceRoot":"","sources":["../../../src/themes/definitions/tmLight.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGnC,eAAe;IACd,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IACb,UAAU,EAAE;QACX,WAAW,EAAE,GAAG,CAAC,WAAW,CAAC,SAAS,CAAC,SAAS,CAAC;QACjD,aAAa,EAAE,SAAS;QACxB,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,wBAAwB;QACxC,yBAAyB,EAAE,SAAS;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BAA6B,EAAE,SAAS;QACxC,iCAAiC,EAAE,SAAS;QAE5C,uBAAuB,EAAE,SAAS;QAElC,mCAAmC,EAAE,SAAS;QAC9C,+BAA+B,EAAE,SAAS;QAC1C,6BAA6B,EAAE,SAAS;QAExC,kCAAkC,EAAE,SAAS;QAC7C,8BAA8B,EAAE,SAAS;QACzC,4BAA4B,EAAE,SAAS;QAEvC,gCAAgC,EAAE,SAAS;QAC3C,4BAA4B,EAAE,SAAS;QACvC,0BAA0B,EAAE,SAAS;QAErC,iCAAiC,EAAE,SAAS;QAC5C,6BAA6B,EAAE,SAAS;QACxC,2BAA2B,EAAE,SAAS;QAEtC,iCAAiC,EAAE,SAAS;QAC5C,6BAA6B,EAAE,SAAS;QACxC,2BAA2B,EAAE,SAAS;QAEtC,6BAA6B,EAAE,SAAS;QAExC,yBAAyB,EAAE,SAAS;QACpC,qBAAqB,EAAE,SAAS;KAChC;CACQ,CAAC","sourcesContent":["import constants from '../../constants';\nimport { dom } from '../../common';\nimport { Theme } from '../../types';\n\nexport default {\n\tname: 'light',\n\ttype: 'light',\n\tdefinition: {\n\t\t'font-size': dom.numToPixels(constants.FONT_SIZE),\n\t\t'font-family': 'verdana',\n\t\t'base-radius': '3px',\n\t\t'button-color': 'var(--og-accent-color)',\n\t\t'button-background-color': '#ffffff',\n\t\t'button-background-color-highlight': '#cccccc',\n\t\t'background': '#ffffff',\n\t\t'background-color': '#ffffff',\n\t\t'background-color-2': '#eeeeee',\n\t\t'background-color-3': '#eeeeee',\n\t\t'text-highlight-color': '#9b8400',\n\t\t'text-color': '#000000',\n\t\t'text-color-2': '#ffffff',\n\t\t'text-color-3': '#000000',\n\t\t'text-color-reversed': '#ffffff',\n\t\t'border': '#cccccc',\n\t\t'border-color': '#cccccc',\n\t\t'border-color-2': '#939393',\n\t\t'cell-background': '#ffffff',\n\t\t'cell-border': '1px solid #cccccc',\n\t\t'hcell-background': '#ececec',\n\t\t'slider-background-color': '#eeeeee',\n\t\t'slider-background-active': '#e2e2e2',\n\t\t'slider-bar-color': '#aaaaaa',\n\t\t'slider-bar-active': '#aaaaaa',\n\t\t'expander-color': '#707070',\n\t\t'expander-hover': '#00955d',\n\t\t'expander-background-color': '#dbdbdb',\n\t\t'sizer-background': '#00955d',\n\t\t'frozen-border': '#b7b7b7',\n\t\t'inset-shadow-color': '#707070',\n\t\t\n\t\t'commands-color': '#000000',\n\t\t'commands-background': '#ffffff',\n\t\t'commands-header-background': '#cdcdcd',\n\t\t'commands-input-background': '#f1f1f1',\n\t\t'commands-shadow': '#7e7e7e',\n\t\n\t\t'dialog-color': '#000000',\n\t\t'dialog-background': '#ffffff',\n\t\t'dialog-header-background': '#cdcdcd',\n\t\t'dialog-shadow': '#7e7e7e',\n\t\t\n\t\t'tab-border-color': '#939393',\n\t\t'tab-background-color': '#f4f4f4',\n\t\t'tab-panel-background-color': '#f4f4f4',\n\t\t'tab-background-color-active': '#ffffff',\n\t\t\n\t\t'bucket-tab-background-color': '#f4f4f4',\n\t\t'bucket-tab-panel-background-color': '#f4f4f4',\n\t\t'bucket-tab-background-color-active': '#ffffff',\n\t\t'bucket-right-background-color': '#ffffff',\n\t\t'bucket-border-color': '#939393',\n\t\t'bucket-center-background-color': '#d8d8d8',\n\t\t'bucket-left-background-color': '#f3f3f3',\n\t\t'bucket-top-background-color': '#e5e5e5',\n\t\t'bucket-sidebar-background-color': '#f3f3f3',\n\t\t\n\t\t'form-background-color': '#e5e5e5',\n\t\n\t\t'colortype-yellow-background-color': '#e2d68d',\n\t\t'colortype-yellow-border-color': '#9b8100',\n\t\t'colortype-yellow-text-color': '#000000',\n\t\n\t\t'colortype-green-background-color': '#7ecf7e',\n\t\t'colortype-green-border-color': '#00b420',\n\t\t'colortype-green-text-color': '#000000',\n\t\n\t\t'colortype-red-background-color': '#ed8181',\n\t\t'colortype-red-border-color': '#fb1515',\n\t\t'colortype-red-text-color': '#000000',\n\t\n\t\t'colortype-blue-background-color': '#88b0ff',\n\t\t'colortype-blue-border-color': '#007cdc',\n\t\t'colortype-blue-text-color': '#000000',\n\t\n\t\t'colortype-gray-background-color': '#dadada',\n\t\t'colortype-gray-border-color': '#cbcbcb',\n\t\t'colortype-gray-text-color': '#000000',\n\t\n\t\t'colortype-accent-text-color': '#ffffff',\n\t\n\t\t'switch-background-color': '#cccccc',\n\t\t'switch-slider-color': '#ffffff',\n\t},\n} as Theme;"]}
1
+ {"version":3,"file":"tmLight.js","sourceRoot":"","sources":["../../../src/themes/definitions/tmLight.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGnC,eAAe;IACd,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IACb,UAAU,EAAE;QACX,WAAW,EAAE,GAAG,CAAC,WAAW,CAAC,SAAS,CAAC,SAAS,CAAC;QACjD,aAAa,EAAE,SAAS;QACxB,aAAa,EAAE,KAAK;QACpB,aAAa,EAAE,gCAAgC;QAC/C,cAAc,EAAE,wBAAwB;QACxC,yBAAyB,EAAE,SAAS;QACpC,mCAAmC,EAAE,SAAS;QAC9C,YAAY,EAAE,SAAS;QACvB,kBAAkB,EAAE,SAAS;QAC7B,oBAAoB,EAAE,SAAS;QAC/B,oBAAoB,EAAE,SAAS;QAC/B,sBAAsB,EAAE,SAAS;QACjC,YAAY,EAAE,SAAS;QACvB,cAAc,EAAE,SAAS;QACzB,cAAc,EAAE,SAAS;QACzB,qBAAqB,EAAE,SAAS;QAChC,QAAQ,EAAE,SAAS;QACnB,cAAc,EAAE,SAAS;QACzB,gBAAgB,EAAE,SAAS;QAC3B,iBAAiB,EAAE,SAAS;QAC5B,aAAa,EAAE,mBAAmB;QAClC,kBAAkB,EAAE,SAAS;QAC7B,yBAAyB,EAAE,SAAS;QACpC,0BAA0B,EAAE,SAAS;QACrC,kBAAkB,EAAE,SAAS;QAC7B,mBAAmB,EAAE,SAAS;QAC9B,gBAAgB,EAAE,SAAS;QAC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AS;KAChC;CACQ,CAAC","sourcesContent":["import constants from '../../constants';\nimport { dom } from '../../common';\nimport { Theme } from '../../types';\n\nexport default {\n\tname: 'light',\n\ttype: 'light',\n\tdefinition: {\n\t\t'font-size': dom.numToPixels(constants.FONT_SIZE),\n\t\t'font-family': 'verdana',\n\t\t'base-radius': '3px',\n\t\t'base-shadow': '0 4px 12px rgba(0, 0, 0, 0.12)',\n\t\t'button-color': 'var(--og-accent-color)',\n\t\t'button-background-color': '#ffffff',\n\t\t'button-background-color-highlight': '#cccccc',\n\t\t'background': '#ffffff',\n\t\t'background-color': '#ffffff',\n\t\t'background-color-2': '#eeeeee',\n\t\t'background-color-3': '#eeeeee',\n\t\t'text-highlight-color': '#9b8400',\n\t\t'text-color': '#000000',\n\t\t'text-color-2': '#ffffff',\n\t\t'text-color-3': '#000000',\n\t\t'text-color-reversed': '#ffffff',\n\t\t'border': '#cccccc',\n\t\t'border-color': '#cccccc',\n\t\t'border-color-2': '#939393',\n\t\t'cell-background': '#ffffff',\n\t\t'cell-border': '1px solid #cccccc',\n\t\t'hcell-background': '#ececec',\n\t\t'slider-background-color': '#eeeeee',\n\t\t'slider-background-active': '#e2e2e2',\n\t\t'slider-bar-color': '#aaaaaa',\n\t\t'slider-bar-active': '#aaaaaa',\n\t\t'expander-color': '#707070',\n\t\t'expander-hover': '#00955d',\n\t\t'expander-background-color': '#dbdbdb',\n\t\t'sizer-background': '#00955d',\n\t\t'frozen-border': '#b7b7b7',\n\t\t'inset-shadow-color': '#707070',\n\t\t\n\t\t'commands-color': '#000000',\n\t\t'commands-background': '#ffffff',\n\t\t'commands-header-background': '#cdcdcd',\n\t\t'commands-input-background': '#f1f1f1',\n\t\t'commands-shadow': '#7e7e7e',\n\t\n\t\t'dialog-color': '#000000',\n\t\t'dialog-background': '#ffffff',\n\t\t'dialog-header-background': '#cdcdcd',\n\t\t'dialog-shadow': '#7e7e7e',\n\t\t\n\t\t'tab-border-color': '#939393',\n\t\t'tab-background-color': '#f4f4f4',\n\t\t'tab-panel-background-color': '#f4f4f4',\n\t\t'tab-background-color-active': '#ffffff',\n\t\t\n\t\t'bucket-tab-background-color': '#f4f4f4',\n\t\t'bucket-tab-panel-background-color': '#f4f4f4',\n\t\t'bucket-tab-background-color-active': '#ffffff',\n\t\t'bucket-right-background-color': '#ffffff',\n\t\t'bucket-border-color': '#939393',\n\t\t'bucket-center-background-color': '#d8d8d8',\n\t\t'bucket-left-background-color': '#f3f3f3',\n\t\t'bucket-top-background-color': '#e5e5e5',\n\t\t'bucket-sidebar-background-color': '#f3f3f3',\n\t\t\n\t\t'form-background-color': '#e5e5e5',\n\t\n\t\t'colortype-yellow-background-color': '#FBC02D',\n\t\t'colortype-yellow-border-color': '#FBC02D',\n\t\t'colortype-yellow-text-color': '#424242',\n\t\n\t\t'colortype-green-background-color': '#43A047',\n\t\t'colortype-green-border-color': '#43A047',\n\t\t'colortype-green-text-color': '#FFFFFF',\n\t\n\t\t'colortype-red-background-color': '#EF5350',\n\t\t'colortype-red-border-color': '#EF5350',\n\t\t'colortype-red-text-color': '#FFFFFF',\n\t\n\t\t'colortype-blue-background-color': '#1E88E5',\n\t\t'colortype-blue-border-color': '#1E88E5',\n\t\t'colortype-blue-text-color': '#FFFFFF',\n\t\n\t\t'colortype-gray-background-color': '#D9D9D9',\n\t\t'colortype-gray-border-color': '#D9D9D9',\n\t\t'colortype-gray-text-color': '#212121',\n\t\n\t\t'colortype-accent-text-color': '#ffffff',\n\t\n\t\t'switch-background-color': '#cccccc',\n\t\t'switch-slider-color': '#ffffff',\n\t},\n} as Theme;"]}
@@ -6,6 +6,7 @@ export declare class DropdownEvent extends Event {
6
6
  }
7
7
  export declare class DropdownContainer extends LitElement {
8
8
  static styles: import("lit").CSSResult;
9
+ color: ColorTypes;
9
10
  constructor();
10
11
  render: () => TemplateResult<1>;
11
12
  }
@@ -37,7 +38,9 @@ export declare class Dropdown extends LitElement implements Layout {
37
38
  renderLabel: () => import("lit-html/directive").DirectiveResult<typeof import("lit-html/directives/unsafe-html").UnsafeHTMLDirective>;
38
39
  get hasLabelSlot(): boolean;
39
40
  get hasLabel(): boolean;
41
+ updated(props: Map<string, unknown>): void;
40
42
  render: () => TemplateResult<1>;
43
+ get useRadiusFix(): boolean;
41
44
  layout(): void;
42
45
  }
43
46
  //# sourceMappingURL=dropdown.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dropdown.d.ts","sourceRoot":"","sources":["../../src/ui/dropdown.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,cAAc,EAAE,MAAM,KAAK,CAAC;AAE5D,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAK9C,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAKlC,qBAAa,aAAc,SAAQ,KAAK;gBAE3B,KAAK,EAAE,MAAM;CAGzB;AAED,qBACa,iBAAkB,SAAQ,UAAU;IAEhD,MAAM,CAAC,MAAM,0BAkBX;;IAOF,MAAM,0BAA6D;CACnE;AAED,qBAEa,QAAS,SAAQ,UAAW,YAAW,MAAM;IAEzD,MAAM,CAAC,MAAM,4BAmCV;IAGH,SAAS,EAAE,MAAM,GAAC,OAAO,CAAW;IAGpC,cAAc,SAAK;IAGnB,cAAc,EAAE,WAAW,CAAiB;IAG5C,SAAS,SAAO;IAGhB,KAAK,EAAE,MAAM,GAAC,WAAW,GAAC,cAAc,CAAC;IAGzC,IAAI,EAAE,QAAQ,GAAC,MAAM,CAAC;IAGtB,KAAK,EAAE,MAAM,CAAC;IAGd,KAAK,aAAqB;IAG1B,OAAO,UAAS;IAGhB,QAAQ,EAAE,cAAc,CAAC;IAEzB,OAAO,CAAC,WAAW,CAAc;IAEjC,SAAS,CAAC,WAAW,8DAAkC;IACvD,IAAI,QAAQ,sBAAqC;IAEjD,IAAI,MAAM,YAA2D;IAErE,iBAAiB,IAAI,IAAI;IAKzB,oBAAoB,GAAI,GAAG,UAAU,UAKpC;IAED,eAAe,CAAC,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;IAED,eAAe,CAAC,OAAO,EAAE,MAAM;IAWzB,IAAI;IA4BV,KAAK;IAML,MAAM;IAKN,YAAY,sBAA6B;IAEzC,oBAAoB;IAKpB,cAAc,0BAIZ;IAEF,WAAW,2HAMT;IAEF,IAAI,YAAY,YAEf;IAED,IAAI,QAAQ,YAEX;IAED,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IAKnC,MAAM,0BAeJ;IAEF,IAAI,YAAY,YAEf;IAED,MAAM;CA0BN"}
@@ -22,13 +22,13 @@ export class DropdownEvent extends Event {
22
22
  let DropdownContainer = class DropdownContainer extends LitElement {
23
23
  constructor() {
24
24
  super();
25
+ this.color = ColorTypes.Accent;
25
26
  this.render = () => html `<div><slot name="inner-content"></slot></div>`;
26
27
  this.addEventListener('mousedown', (e) => e.stopPropagation());
27
28
  }
28
29
  };
29
30
  DropdownContainer.styles = css `
30
31
  :host {
31
- border: 1px solid var(--og-accent-color);
32
32
  background-color: var(--og-background-color);
33
33
  position: absolute;
34
34
  overflow: hidden;
@@ -37,7 +37,8 @@ DropdownContainer.styles = css `
37
37
  z-index: 60000;
38
38
  font-size: var(--og-font-size);
39
39
  font-family: var(--og-font-family);
40
- border-radius: var(--og-base-radius);
40
+ border-radius: var(--og-base-radius);
41
+ box-shadow: var(--og-base-shadow);
41
42
  }
42
43
 
43
44
  :host(.radiusfix) {
@@ -45,8 +46,12 @@ DropdownContainer.styles = css `
45
46
  border-top-right-radius: 0;
46
47
  }
47
48
  `;
49
+ __decorate([
50
+ property({ type: String, reflect: true })
51
+ ], DropdownContainer.prototype, "color", void 0);
48
52
  DropdownContainer = __decorate([
49
- customElement('og-dropdown-container')
53
+ customElement('og-dropdown-container'),
54
+ colorable({ props: ['border'] })
50
55
  ], DropdownContainer);
51
56
  export { DropdownContainer };
52
57
  let Dropdown = class Dropdown extends LitElement {
@@ -159,11 +164,19 @@ let Dropdown = class Dropdown extends LitElement {
159
164
  get hasLabel() {
160
165
  return this.label !== '' && this.label != null;
161
166
  }
167
+ updated(props) {
168
+ super.updated(props);
169
+ if (this.dropdown)
170
+ this.dropdown.color = this.color == ColorTypes.Transparent ? ColorTypes.Accent : this.color;
171
+ }
172
+ get useRadiusFix() {
173
+ return this.isOpen && this.color != ColorTypes.Transparent;
174
+ }
162
175
  layout() {
163
- this.classList.toggle('radiusfix', this.isOpen);
176
+ this.classList.toggle('radiusfix', this.useRadiusFix);
164
177
  if (!this.dropdown)
165
178
  return;
166
- this.dropdown.classList.toggle('radiusfix', this.isOpen);
179
+ this.dropdown.classList.toggle('radiusfix', this.useRadiusFix);
167
180
  if (!this.isOpen)
168
181
  return;
169
182
  const offset = dom.getElementOffset(this, this.dropdownParent);
@@ -1 +1 @@
1
- {"version":3,"file":"dropdown.js","sourceRoot":"","sources":["../../src/ui/dropdown.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAkB,MAAM,KAAK,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,UAAU,EAAU,MAAM,UAAU,CAAC;AAC9C,OAAO,KAAK,GAAG,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAEhD,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,MAAM,OAAO,aAAc,SAAQ,KAAK;IAEvC,YAAY,KAAa;QACxB,KAAK,CAAC,YAAY,KAAK,EAAE,CAAC,CAAC;IAC5B,CAAC;CACD;AAGM,IAAM,iBAAiB,GAAv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,WAAW,GAAG,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW;aACzF,CAAC,CAAC;QACJ,CAAC;IAEF,CAAC;;AA9MM,eAAM,GAAG,CAAC,GAAG,CAAA;;;;;;;;;;;;aAYR,SAAS,CAAC,aAAa;;;;;;;;;;;;;;;;;;;;;;;EAuBlC,CAAC,AAnCW,CAmCV;AAGH;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;2CACW;AAGpC;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;gDACN;AAGnB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;gDACmB;AAG5C;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;2CACT;AAGhB;IADC,QAAQ,EAAE;uCAC8B;AAGzC;IADC,QAAQ,EAAE;sCACW;AAGtB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;uCACX;AAGd;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;uCACd;AAG1B;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;yCACV;AAGhB;IADC,KAAK,CAAC,QAAQ,CAAC;0CACS;AAnEb,QAAQ;IAFpB,aAAa,CAAC,aAAa,CAAC;IAC5B,SAAS,CAAC,EAAC,KAAK,EAAE,CAAC,QAAQ,CAAC,EAAC,CAAC;GAClB,QAAQ,CAkNpB","sourcesContent":["import { LitElement, html, css, TemplateResult } from 'lit';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport { ColorTypes, Layout } from '../types';\nimport * as dom from '../common/dom';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js';\nimport { createRef, ref } from 'lit-html/directives/ref.js';\nimport { guard } from 'lit/directives/guard.js';\nimport { IconSpec } from './icon';\nimport { utils } from '../common';\nimport { colorable } from '../themes';\nimport constants from '../constants';\n\nexport class DropdownEvent extends Event {\n\n\tconstructor(event: string) {\n\t\tsuper(`dropdown.${event}`);\n\t}\n}\n\n@customElement('og-dropdown-container')\nexport class DropdownContainer extends LitElement {\n\n\tstatic styles = css`\n\t\t:host {\n\t\t\tborder: 1px solid var(--og-accent-color);\n\t\t\tbackground-color: var(--og-background-color);\n\t\t\tposition: absolute;\n\t\t\toverflow: hidden;\n\t\t\tbox-sizing: border-box;\n\t\t\tcolor: var(--og-text-color);\n\t\t\tz-index: 60000;\n\t\t\tfont-size: var(--og-font-size);\n\t\t\tfont-family: var(--og-font-family);\n\t\t\tborder-radius: var(--og-base-radius);\t\t\t\n\t\t}\n\n\t\t:host(.radiusfix) {\n\t\t\tborder-top-left-radius: 0;\n\t\t\tborder-top-right-radius: 0;\n\t\t}\n\t`;\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.addEventListener('mousedown', (e: MouseEvent) => e.stopPropagation());\n\t}\n\n\trender = () => html`<div><slot name=\"inner-content\"></slot></div>`;\n}\n\n@customElement('og-dropdown')\n@colorable({props: ['border']})\nexport class Dropdown extends LitElement implements Layout {\n\n\tstatic styles = [css`\n\t\t:host {\n\t\t\tbox-sizing: border-box;\n\t\t\tdisplay: flex;\n\t\t\talign-items: stretch;\n\t\t\tflex-direction: row;\n\t\t\tfont-size: var(--og-font-size);\n\t\t\tfont-family: var(--og-font-family);\n\t\t\tcursor: pointer;\n\t\t\tuser-select: none;\n\t\t\toutline: none;\n\t\t\tborder-radius: var(--og-base-radius);\n\t\t\theight: ${constants.BUTTON_HEIGHT}px;\n\t\t}\n\n\t\t:host(.radiusfix) {\n\t\t\tborder-bottom-left-radius: 0;\n\t\t\tborder-bottom-right-radius: 0;\n\t\t}\n\n\t\tdiv.text {\n\t\t\tflex: 1;\n\t\t\tcolor: var(--og-text-color-1);\n\t\t\tpadding-left: 2px;\n\t\t\twhite-space: nowrap;\n\t\t\ttext-overflow: ellipsis;\n\t\t\toverflow: hidden;\n\t\t}\n\n\t\tog-button {\n\t\t\tflex: 1;\n\t\t\tborder-radius: 0;\n\t\t\tborder: none;\n\t\t\theight: 100%;\n\t\t}\n\t`];\n\n\t@property({type: String})\n\talignment: 'left'|'right' = 'right';\n\n\t@property({type: Number})\n\tpositionOffset = 0;\n\n\t@property({type: Object})\n\tdropdownParent: HTMLElement = document.body;\n\n\t@property({type: Number})\n\tanimation = 0.1;\n\n\t@property()\n\tlabel: string|HTMLElement|TemplateResult;\n\n\t@property()\n\ticon: IconSpec|string;\n\n\t@property({type: Number})\n\twidth: number;\n\n\t@property({type: String, reflect: true})\n\tcolor = ColorTypes.Accent;\n\n\t@property({type: Boolean})\n\tnoCaret = false;\n\n\t@query('.label')\n\tlabelElm: HTMLDivElement;\n\n\tprivate _contentElm: HTMLElement;\n\n\tprotected dropdownRef = createRef<DropdownContainer>();\n\tget dropdown() { return this.dropdownRef?.value }\n\n\tget isOpen() { return this.dropdown && !dom.isHidden(this.dropdown) }\n\n\tconnectedCallback(): void {\n\t\tsuper.connectedCallback();\n\t\tthis.tabIndex = 0;\n\t}\n\n\t_onDocumentMouseDown = (e: MouseEvent) => {\n\t\tfor (const elm of e.composedPath()) {\n\t\t\tif (elm == this.dropdown || elm == this) return;\n\t\t}\n\t\tthis.close();\n\t}\n\n\tanimateDropdown(seconds: number) {\n\t\tconst height = this.dropdown.offsetHeight;\n\t\tdom.setSize(this.dropdown, {h: 0});\n\t\tthis.dropdown.style.transition = `height ${seconds}s ease-in-out`;\n\t\tsetTimeout(() => dom.setSize(this.dropdown, {h: height}), 0);\n\t\tsetTimeout(() => {\n\t\t\tthis.dropdown.style.height = 'auto';\n\t\t\tthis.dropdown.style.transition = '';\n\t\t}, seconds * 1000);\n\t}\n\n\tasync open() {\n\t\tthis.dispatchEvent(new DropdownEvent('beforeOpen'));\n\t\tawait this.updateComplete;\n\t\t\n\t\tif (this.dropdown.parentElement !== this.dropdownParent) {\n\t\t\tthis.dropdownParent.appendChild(this.dropdown);\n\t\t}\n\n\t\tif (this.children.length > 0 && !this._contentElm) {\n\t\t\tthis._contentElm = [...this.children].find(elm => elm.slot == 'content') as HTMLElement;\n\t\t\tif (this._contentElm) {\n\t\t\t\tthis._contentElm.slot = 'inner-content';\n\t\t\t\tthis.dropdown.appendChild(this._contentElm);\n\t\t\t}\n\t\t}\n\n\t\tif (this.width > 0) dom.setSize(this.dropdown, {w: this.width});\n\t\tdom.showElement(this.dropdown);\n\t\tthis.requestUpdate();\n\t\tawait this.dropdown.updateComplete;\n\t\tthis.dispatchEvent(new DropdownEvent('open'));\n\t\tthis.layout();\n\n\t\tif (this.animation > 0) this.animateDropdown(this.animation);\n\n\t\tdocument.body.addEventListener('mousedown', this._onDocumentMouseDown);\n\t}\n\n\tclose() {\n\t\tif (this.dropdown) dom.hideElement(this.dropdown);\n\t\tthis.layout();\n\t\tdocument.body.removeEventListener('mousedown', this._onDocumentMouseDown);\n\t}\n\n\ttoggle() {\n\t\tif (this.isOpen) this.close();\n\t\telse this.open();\n\t}\n\n\t_onMousedown = async () => this.toggle();\n\n\tdisconnectedCallback() {\n\t\tthis.dropdown?.remove();\n\t\tsuper.disconnectedCallback();\n\t}\n\n\trenderDropdown = () => html`\n\t\t<og-dropdown-container ${ref(this.dropdownRef)}\n\t\t\tstyle=\"display: none\">\n\t\t</og-dropdown-container>\n\t`;\n\n\trenderLabel = () => {\n\t\tif (utils.isString(this.label)) {\n\t\t\treturn this.label === '' ? unsafeHTML('&nbsp;') : html`<div class=\"text\">${this.label}</div>`;\n\t\t} else {\n\t\t\treturn this.label;\n\t\t}\n\t};\n\n\tget hasLabelSlot() {\n\t\treturn this.querySelector('[slot=\"label\"]') != null;\n\t}\n\n\tget hasLabel() {\n\t\treturn this.label !== '' && this.label != null;\n\t}\n\n\trender = () => html`\n\t\t<og-button\n\t\t\t@mousedown=\"${this._onMousedown}\"\n\t\t\tclass=\"main\"\n\t\t\tcolor=\"${this.color}\"\n\t\t\t.icon=\"${this.icon}\"\n\t\t\t?caret=\"${!this.noCaret}\">\n\t\t\t${this.hasLabelSlot ? html`\n\t\t\t\t<div class=\"label\" slot=\"content\"><slot name=\"label\"></slot></div>\n\t\t\t` : guard([this.label], () => (this.hasLabel ? html`\n\t\t\t\t<div class=\"label\" slot=\"content\">${this.renderLabel()}</div>\n\t\t\t` : ''))}\n\t\t</og-button>\n\n\t\t${this.renderDropdown()}\n\t`;\n\n\tlayout() {\n\t\tthis.classList.toggle('radiusfix', this.isOpen);\n\t\tif (!this.dropdown) return;\n\t\tthis.dropdown.classList.toggle('radiusfix', this.isOpen);\n\t\tif (!this.isOpen) return;\n\n\t\tconst offset = dom.getElementOffset(this, this.dropdownParent);\n\t\tdom.setSize(this.dropdown, {w: this.offsetWidth}, true);\n\n\t\tif (this.alignment == 'left') {\n\t\t\tthis.dropdown.style.right = 'auto';\n\t\t\tdom.setPosition(this.dropdown, {\n\t\t\t\tt: offset.top + this.offsetHeight - 1, \n\t\t\t\tl: this.positionOffset + offset.left\n\t\t\t});\n\t\t\tdom.fixElementPosition(this.dropdown);\n\t\t} else {\n\t\t\tthis.dropdown.style.left = 'auto';\n\t\t\tdom.setPosition(this.dropdown, {\n\t\t\t\tt: offset.top + this.offsetHeight - 1, \n\t\t\t\tr: this.dropdownParent.clientWidth - this.positionOffset - offset.left - this.offsetWidth\n\t\t\t});\n\t\t}\n\n\t}\n\n}"]}
1
+ {"version":3,"file":"dropdown.js","sourceRoot":"","sources":["../../src/ui/dropdown.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAkB,MAAM,KAAK,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,UAAU,EAAU,MAAM,UAAU,CAAC;AAC9C,OAAO,KAAK,GAAG,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA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,CAAC,AAnCW,CAmCV;AAGH;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;2CACW;AAGpC;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;gDACN;AAGnB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;gDACmB;AAG5C;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;2CACT;AAGhB;IADC,QAAQ,EAAE;uCAC8B;AAGzC;IADC,QAAQ,EAAE;sCACW;AAGtB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;uCACX;AAGd;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;uCACd;AAG1B;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;yCACV;AAGhB;IADC,KAAK,CAAC,QAAQ,CAAC;0CACS;AAnEb,QAAQ;IAFpB,aAAa,CAAC,aAAa,CAAC;IAC5B,SAAS,CAAC,EAAC,KAAK,EAAE,CAAC,QAAQ,CAAC,EAAC,CAAC;GAClB,QAAQ,CA2NpB","sourcesContent":["import { LitElement, html, css, TemplateResult } from 'lit';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport { ColorTypes, Layout } from '../types';\nimport * as dom from '../common/dom';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js';\nimport { createRef, ref } from 'lit-html/directives/ref.js';\nimport { guard } from 'lit/directives/guard.js';\nimport { IconSpec } from './icon';\nimport { utils } from '../common';\nimport { colorable } from '../themes';\nimport constants from '../constants';\n\nexport class DropdownEvent extends Event {\n\n\tconstructor(event: string) {\n\t\tsuper(`dropdown.${event}`);\n\t}\n}\n\n@customElement('og-dropdown-container')\n@colorable({props: ['border']})\nexport class DropdownContainer extends LitElement {\n\n\tstatic styles = css`\n\t\t:host {\n\t\t\tbackground-color: var(--og-background-color);\n\t\t\tposition: absolute;\n\t\t\toverflow: hidden;\n\t\t\tbox-sizing: border-box;\n\t\t\tcolor: var(--og-text-color);\n\t\t\tz-index: 60000;\n\t\t\tfont-size: var(--og-font-size);\n\t\t\tfont-family: var(--og-font-family);\n\t\t\tborder-radius: var(--og-base-radius);\n\t\t\tbox-shadow: var(--og-base-shadow);\n\t\t}\n\n\t\t:host(.radiusfix) {\n\t\t\tborder-top-left-radius: 0;\n\t\t\tborder-top-right-radius: 0;\n\t\t}\n\t`;\n\n\t@property({type: String, reflect: true})\n\tcolor = ColorTypes.Accent;\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.addEventListener('mousedown', (e: MouseEvent) => e.stopPropagation());\n\t}\n\n\trender = () => html`<div><slot name=\"inner-content\"></slot></div>`;\n}\n\n@customElement('og-dropdown')\n@colorable({props: ['border']})\nexport class Dropdown extends LitElement implements Layout {\n\n\tstatic styles = [css`\n\t\t:host {\n\t\t\tbox-sizing: border-box;\n\t\t\tdisplay: flex;\n\t\t\talign-items: stretch;\n\t\t\tflex-direction: row;\n\t\t\tfont-size: var(--og-font-size);\n\t\t\tfont-family: var(--og-font-family);\n\t\t\tcursor: pointer;\n\t\t\tuser-select: none;\n\t\t\toutline: none;\n\t\t\tborder-radius: var(--og-base-radius);\n\t\t\theight: ${constants.BUTTON_HEIGHT}px;\n\t\t}\n\n\t\t:host(.radiusfix) {\n\t\t\tborder-bottom-left-radius: 0;\n\t\t\tborder-bottom-right-radius: 0;\n\t\t}\n\n\t\tdiv.text {\n\t\t\tflex: 1;\n\t\t\tcolor: var(--og-text-color-1);\n\t\t\tpadding-left: 2px;\n\t\t\twhite-space: nowrap;\n\t\t\ttext-overflow: ellipsis;\n\t\t\toverflow: hidden;\n\t\t}\n\n\t\tog-button {\n\t\t\tflex: 1;\n\t\t\tborder-radius: 0;\n\t\t\tborder: none;\n\t\t\theight: 100%;\n\t\t}\n\t`];\n\n\t@property({type: String})\n\talignment: 'left'|'right' = 'right';\n\n\t@property({type: Number})\n\tpositionOffset = 0;\n\n\t@property({type: Object})\n\tdropdownParent: HTMLElement = document.body;\n\n\t@property({type: Number})\n\tanimation = 0.1;\n\n\t@property()\n\tlabel: string|HTMLElement|TemplateResult;\n\n\t@property()\n\ticon: IconSpec|string;\n\n\t@property({type: Number})\n\twidth: number;\n\n\t@property({type: String, reflect: true})\n\tcolor = ColorTypes.Accent;\n\n\t@property({type: Boolean})\n\tnoCaret = false;\n\n\t@query('.label')\n\tlabelElm: HTMLDivElement;\n\n\tprivate _contentElm: HTMLElement;\n\n\tprotected dropdownRef = createRef<DropdownContainer>();\n\tget dropdown() { return this.dropdownRef?.value }\n\n\tget isOpen() { return this.dropdown && !dom.isHidden(this.dropdown) }\n\n\tconnectedCallback(): void {\n\t\tsuper.connectedCallback();\n\t\tthis.tabIndex = 0;\n\t}\n\n\t_onDocumentMouseDown = (e: MouseEvent) => {\n\t\tfor (const elm of e.composedPath()) {\n\t\t\tif (elm == this.dropdown || elm == this) return;\n\t\t}\n\t\tthis.close();\n\t}\n\n\tanimateDropdown(seconds: number) {\n\t\tconst height = this.dropdown.offsetHeight;\n\t\tdom.setSize(this.dropdown, {h: 0});\n\t\tthis.dropdown.style.transition = `height ${seconds}s ease-in-out`;\n\t\tsetTimeout(() => dom.setSize(this.dropdown, {h: height}), 0);\n\t\tsetTimeout(() => {\n\t\t\tthis.dropdown.style.height = 'auto';\n\t\t\tthis.dropdown.style.transition = '';\n\t\t}, seconds * 1000);\n\t}\n\n\tasync open() {\n\t\tthis.dispatchEvent(new DropdownEvent('beforeOpen'));\n\t\tawait this.updateComplete;\n\t\t\n\t\tif (this.dropdown.parentElement !== this.dropdownParent) {\n\t\t\tthis.dropdownParent.appendChild(this.dropdown);\n\t\t}\n\n\t\tif (this.children.length > 0 && !this._contentElm) {\n\t\t\tthis._contentElm = [...this.children].find(elm => elm.slot == 'content') as HTMLElement;\n\t\t\tif (this._contentElm) {\n\t\t\t\tthis._contentElm.slot = 'inner-content';\n\t\t\t\tthis.dropdown.appendChild(this._contentElm);\n\t\t\t}\n\t\t}\n\n\t\tif (this.width > 0) dom.setSize(this.dropdown, {w: this.width});\n\t\tdom.showElement(this.dropdown);\n\t\tthis.requestUpdate();\n\t\tawait this.dropdown.updateComplete;\n\t\tthis.dispatchEvent(new DropdownEvent('open'));\n\t\tthis.layout();\n\n\t\tif (this.animation > 0) this.animateDropdown(this.animation);\n\n\t\tdocument.body.addEventListener('mousedown', this._onDocumentMouseDown);\n\t}\n\n\tclose() {\n\t\tif (this.dropdown) dom.hideElement(this.dropdown);\n\t\tthis.layout();\n\t\tdocument.body.removeEventListener('mousedown', this._onDocumentMouseDown);\n\t}\n\n\ttoggle() {\n\t\tif (this.isOpen) this.close();\n\t\telse this.open();\n\t}\n\n\t_onMousedown = async () => this.toggle();\n\n\tdisconnectedCallback() {\n\t\tthis.dropdown?.remove();\n\t\tsuper.disconnectedCallback();\n\t}\n\n\trenderDropdown = () => html`\n\t\t<og-dropdown-container ${ref(this.dropdownRef)}\n\t\t\tstyle=\"display: none\">\n\t\t</og-dropdown-container>\n\t`;\n\n\trenderLabel = () => {\n\t\tif (utils.isString(this.label)) {\n\t\t\treturn this.label === '' ? unsafeHTML('&nbsp;') : html`<div class=\"text\">${this.label}</div>`;\n\t\t} else {\n\t\t\treturn this.label;\n\t\t}\n\t};\n\n\tget hasLabelSlot() {\n\t\treturn this.querySelector('[slot=\"label\"]') != null;\n\t}\n\n\tget hasLabel() {\n\t\treturn this.label !== '' && this.label != null;\n\t}\n\n\tupdated(props: Map<string, unknown>) {\n\t\tsuper.updated(props);\n\t\tif (this.dropdown) this.dropdown.color = this.color == ColorTypes.Transparent ? ColorTypes.Accent : this.color;\n\t}\n\n\trender = () => html`\n\t\t<og-button\n\t\t\t@mousedown=\"${this._onMousedown}\"\n\t\t\tclass=\"main\"\n\t\t\tcolor=\"${this.color}\"\n\t\t\t.icon=\"${this.icon}\"\n\t\t\t?caret=\"${!this.noCaret}\">\n\t\t\t${this.hasLabelSlot ? html`\n\t\t\t\t<div class=\"label\" slot=\"content\"><slot name=\"label\"></slot></div>\n\t\t\t` : guard([this.label], () => (this.hasLabel ? html`\n\t\t\t\t<div class=\"label\" slot=\"content\">${this.renderLabel()}</div>\n\t\t\t` : ''))}\n\t\t</og-button>\n\n\t\t${this.renderDropdown()}\n\t`;\n\n\tget useRadiusFix() {\n\t\treturn this.isOpen && this.color != ColorTypes.Transparent;\n\t}\n\n\tlayout() {\n\t\tthis.classList.toggle('radiusfix', this.useRadiusFix);\n\t\tif (!this.dropdown) return;\n\t\tthis.dropdown.classList.toggle('radiusfix', this.useRadiusFix);\n\t\tif (!this.isOpen) return;\n\n\t\tconst offset = dom.getElementOffset(this, this.dropdownParent);\n\t\tdom.setSize(this.dropdown, {w: this.offsetWidth}, true);\n\n\t\tif (this.alignment == 'left') {\n\t\t\tthis.dropdown.style.right = 'auto';\n\t\t\tdom.setPosition(this.dropdown, {\n\t\t\t\tt: offset.top + this.offsetHeight - 1, \n\t\t\t\tl: this.positionOffset + offset.left\n\t\t\t});\n\t\t\tdom.fixElementPosition(this.dropdown);\n\t\t} else {\n\t\t\tthis.dropdown.style.left = 'auto';\n\t\t\tdom.setPosition(this.dropdown, {\n\t\t\t\tt: offset.top + this.offsetHeight - 1, \n\t\t\t\tr: this.dropdownParent.clientWidth - this.positionOffset - offset.left - this.offsetWidth\n\t\t\t});\n\t\t}\n\n\t}\n\n}"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omegagrid/core",
3
- "version": "0.9.22",
3
+ "version": "0.9.24",
4
4
  "license": "UNLICENSED",
5
5
  "description": "Core components",
6
6
  "main": "./dist/index.js",
@@ -36,7 +36,7 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "@fortawesome/fontawesome-svg-core": "^7.0.1",
39
- "@omegagrid/localize": "^0.9.22",
39
+ "@omegagrid/localize": "^0.9.24",
40
40
  "color": "^4.2.3",
41
41
  "date-fns": "^3.2.0",
42
42
  "lit": "^3.1.1",