@omegagrid/core 0.9.23 → 0.9.25
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/dist/themes/definitions/tmDark.d.ts.map +1 -1
- package/dist/themes/definitions/tmDark.js +3 -2
- package/dist/themes/definitions/tmDark.js.map +1 -1
- package/dist/themes/definitions/tmLight.d.ts.map +1 -1
- package/dist/themes/definitions/tmLight.js +6 -5
- package/dist/themes/definitions/tmLight.js.map +1 -1
- package/dist/themes/transformations.d.ts.map +1 -1
- package/dist/themes/transformations.js +25 -19
- package/dist/themes/transformations.js.map +1 -1
- package/dist/ui/dropdown.d.ts +3 -0
- package/dist/ui/dropdown.d.ts.map +1 -1
- package/dist/ui/dropdown.js +18 -5
- package/dist/ui/dropdown.js.map +1 -1
- package/dist/ui/slider.style.d.ts.map +1 -1
- package/dist/ui/slider.style.js +5 -2
- package/dist/ui/slider.style.js.map +1 -1
- package/package.json +2 -2
|
@@ -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;
|
|
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,8 +59,8 @@ 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': '#
|
|
62
|
-
'colortype-yellow-border-color': '#
|
|
62
|
+
'colortype-yellow-background-color': '#e49f30',
|
|
63
|
+
'colortype-yellow-border-color': '#e49f30',
|
|
63
64
|
'colortype-yellow-text-color': '#ffffff',
|
|
64
65
|
'colortype-green-background-color': '#2E7D32',
|
|
65
66
|
'colortype-green-border-color': '#2E7D32',
|
|
@@ -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;Q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,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'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': '#
|
|
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,aAAa,EAAE,4BAA4B;QAC3C,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,iBAAi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C,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': '#e49f30',\n\t\t'colortype-yellow-border-color': '#e49f30',\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;
|
|
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,9 +59,9 @@ 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': '#
|
|
62
|
-
'colortype-yellow-border-color': '#
|
|
63
|
-
'colortype-yellow-text-color': '#
|
|
62
|
+
'colortype-yellow-background-color': '#e49f30',
|
|
63
|
+
'colortype-yellow-border-color': '#e49f30',
|
|
64
|
+
'colortype-yellow-text-color': '#FFFFFF',
|
|
64
65
|
'colortype-green-background-color': '#43A047',
|
|
65
66
|
'colortype-green-border-color': '#43A047',
|
|
66
67
|
'colortype-green-text-color': '#FFFFFF',
|
|
@@ -70,8 +71,8 @@ export default {
|
|
|
70
71
|
'colortype-blue-background-color': '#1E88E5',
|
|
71
72
|
'colortype-blue-border-color': '#1E88E5',
|
|
72
73
|
'colortype-blue-text-color': '#FFFFFF',
|
|
73
|
-
'colortype-gray-background-color': '#
|
|
74
|
-
'colortype-gray-border-color': '#
|
|
74
|
+
'colortype-gray-background-color': '#D9D9D9',
|
|
75
|
+
'colortype-gray-border-color': '#D9D9D9',
|
|
75
76
|
'colortype-gray-text-color': '#212121',
|
|
76
77
|
'colortype-accent-text-color': '#ffffff',
|
|
77
78
|
'switch-background-color': '#cccccc',
|
|
@@ -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;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;QAC3B,gBAAgB,EAAE,SAAS;QAC3B,2BAA2B,EAAE,SAAS;QACtC,kBAAkB,EAAE,SAAS;QAC7B,eAAe,EAAE,SAAS;QAC1B,oBAAoB,EAAE,SAAS;QAE/B,gBAAgB,EAAE,SAAS;QAC3B,qBAAqB,EAAE,SAAS;QAChC,4BAA4B,EAAE,SAAS;QACvC,2BAA2B,EAAE,SAAS;QACtC,iBAAiB,EAAE,SAAS;QAE5B,cAAc,EAAE,SAAS;QACzB,mBAAmB,EAAE,SAAS;QAC9B,0BAA0B,EAAE,SAAS;QACrC,eAAe,EAAE,SAAS;QAE1B,kBAAkB,EAAE,SAAS;QAC7B,sBAAsB,EAAE,SAAS;QACjC,4BAA4B,EAAE,SAAS;QACvC,6BAA6B,EAAE,SAAS;QAExC,6BAA6B,EAAE,SAAS;QACxC,mCAAmC,EAAE,SAAS;QAC9C,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: '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': '#
|
|
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,gBAAg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,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'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': '#e49f30',\n\t\t'colortype-yellow-border-color': '#e49f30',\n\t\t'colortype-yellow-text-color': '#FFFFFF',\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;"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformations.d.ts","sourceRoot":"","sources":["../../src/themes/transformations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"transformations.d.ts","sourceRoot":"","sources":["../../src/themes/transformations.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,eAAe,EAAE;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA;CAChC,EAgCI,CAAC;AAEN,eAAe,eAAe,CAAC"}
|
|
@@ -1,32 +1,38 @@
|
|
|
1
1
|
import { alpha, darken } from "../common/colors";
|
|
2
|
+
import { ColorTypes } from "../types";
|
|
3
|
+
const scale = Array.from({ length: 19 }, (_, i) => (i + 1) * 5);
|
|
2
4
|
const transformations = [{
|
|
3
|
-
from:
|
|
4
|
-
to:
|
|
5
|
+
from: `accent-color`,
|
|
6
|
+
to: `colortype-accent-background-color`,
|
|
7
|
+
transform: (v) => v
|
|
8
|
+
}, {
|
|
9
|
+
from: `accent-color`,
|
|
10
|
+
to: `colortype-accent-border-color`,
|
|
11
|
+
transform: (v) => v //lighten(v, 0.3)
|
|
12
|
+
}, {
|
|
13
|
+
from: `accent-color`,
|
|
14
|
+
to: `accent-color-alpha`,
|
|
5
15
|
transform: (v) => alpha(v)
|
|
6
16
|
}, {
|
|
7
|
-
from:
|
|
8
|
-
to:
|
|
17
|
+
from: `accent-color`,
|
|
18
|
+
to: `accent-color-alpha-15`,
|
|
9
19
|
transform: (v) => alpha(v, 0.15)
|
|
10
20
|
}, {
|
|
11
|
-
from:
|
|
12
|
-
to:
|
|
21
|
+
from: `accent-color`,
|
|
22
|
+
to: `accent-color-alpha-30`,
|
|
13
23
|
transform: (v) => alpha(v, 0.30)
|
|
14
24
|
}, {
|
|
15
|
-
from:
|
|
16
|
-
to:
|
|
25
|
+
from: `accent-color`,
|
|
26
|
+
to: `accent-color-alpha-70`,
|
|
17
27
|
transform: (v) => alpha(v, 0.70)
|
|
18
28
|
}, {
|
|
19
|
-
from:
|
|
20
|
-
to:
|
|
29
|
+
from: `accent-color`,
|
|
30
|
+
to: `accent-color-highlight`,
|
|
21
31
|
transform: (v) => darken(v)
|
|
22
|
-
}, {
|
|
23
|
-
from:
|
|
24
|
-
to:
|
|
25
|
-
transform: (v) => v
|
|
26
|
-
}
|
|
27
|
-
from: 'accent-color',
|
|
28
|
-
to: 'colortype-accent-border-color',
|
|
29
|
-
transform: (v) => v //lighten(v, 0.3)
|
|
30
|
-
}];
|
|
32
|
+
}, ...Object.values(ColorTypes).flatMap(clr => scale.map(amount => ({
|
|
33
|
+
from: `colortype-${clr}-background-color`,
|
|
34
|
+
to: `colortype-${clr}-background-color-dark-${amount}`,
|
|
35
|
+
transform: (v) => darken(v, amount / 100)
|
|
36
|
+
})))];
|
|
31
37
|
export default transformations;
|
|
32
38
|
//# sourceMappingURL=transformations.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformations.js","sourceRoot":"","sources":["../../src/themes/transformations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"transformations.js","sourceRoot":"","sources":["../../src/themes/transformations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AAEhE,MAAM,eAAe,GAIf,CAAC;QACN,IAAI,EAAE,cAAc;QACpB,EAAE,EAAE,mCAAmC;QACvC,SAAS,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC;KAC3B,EAAE;QACF,IAAI,EAAE,cAAc;QACpB,EAAE,EAAE,+BAA+B;QACnC,SAAS,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,iBAAiB;KAC7C,EAAE;QACF,IAAI,EAAE,cAAc;QACpB,EAAE,EAAE,oBAAoB;QACxB,SAAS,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;KAClC,EAAE;QACF,IAAI,EAAE,cAAc;QACpB,EAAE,EAAE,uBAAuB;QAC3B,SAAS,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC;KACxC,EAAE;QACF,IAAI,EAAE,cAAc;QACpB,EAAE,EAAE,uBAAuB;QAC3B,SAAS,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC;KACxC,EAAE;QACF,IAAI,EAAE,cAAc;QACpB,EAAE,EAAE,uBAAuB;QAC3B,SAAS,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC;KACxC,EAAE;QACF,IAAI,EAAE,cAAc;QACpB,EAAE,EAAE,wBAAwB;QAC5B,SAAS,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;KACnC,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAA,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAClE,IAAI,EAAE,aAAa,GAAG,mBAAmB;QACzC,EAAE,EAAE,aAAa,GAAG,0BAA0B,MAAM,EAAE;QACtD,SAAS,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;KACjD,CAAC,CAAC,CAAC,CAAC,CAAC;AAEN,eAAe,eAAe,CAAC","sourcesContent":["import { alpha, darken } from \"../common/colors\";\nimport { ColorTypes } from \"../types\";\n\nconst scale = Array.from({ length: 19 }, (_, i) => (i + 1) * 5);\n\nconst transformations: {\n\tfrom: string, \n\tto: string, \n\ttransform: (v: string) => string\n}[] = [{\n\tfrom: `accent-color`,\n\tto: `colortype-accent-background-color`,\n\ttransform: (v: string) => v\n}, {\n\tfrom: `accent-color`,\n\tto: `colortype-accent-border-color`,\n\ttransform: (v: string) => v //lighten(v, 0.3)\n}, {\n\tfrom: `accent-color`,\n\tto: `accent-color-alpha`,\n\ttransform: (v: string) => alpha(v)\n}, {\n\tfrom: `accent-color`,\n\tto: `accent-color-alpha-15`,\n\ttransform: (v: string) => alpha(v, 0.15)\n}, {\n\tfrom: `accent-color`,\n\tto: `accent-color-alpha-30`,\n\ttransform: (v: string) => alpha(v, 0.30)\n}, {\n\tfrom: `accent-color`,\n\tto: `accent-color-alpha-70`,\n\ttransform: (v: string) => alpha(v, 0.70)\n}, {\n\tfrom: `accent-color`,\n\tto: `accent-color-highlight`,\n\ttransform: (v: string) => darken(v)\n}, ...Object.values(ColorTypes).flatMap(clr =>scale.map(amount => ({\n\tfrom: `colortype-${clr}-background-color`,\n\tto: `colortype-${clr}-background-color-dark-${amount}`,\n\ttransform: (v: string) => darken(v, amount / 100)\n})))];\n\nexport default transformations;"]}
|
package/dist/ui/dropdown.d.ts
CHANGED
|
@@ -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,
|
|
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,qBAEa,iBAAkB,SAAQ,UAAU;IAEhD,MAAM,CAAC,MAAM,0BAkBX;IAGF,KAAK,aAAqB;;IAO1B,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,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"}
|
package/dist/ui/dropdown.js
CHANGED
|
@@ -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.
|
|
176
|
+
this.classList.toggle('radiusfix', this.useRadiusFix);
|
|
164
177
|
if (!this.dropdown)
|
|
165
178
|
return;
|
|
166
|
-
this.dropdown.classList.toggle('radiusfix', this.
|
|
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);
|
package/dist/ui/dropdown.js.map
CHANGED
|
@@ -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,CAA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AAC,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(' ') : 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+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;AAIM,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,UAAU;IAyBhD;QACC,KAAK,EAAE,CAAC;QAHT,UAAK,GAAG,UAAU,CAAC,MAAM,CAAC;QAO1B,WAAM,GAAG,GAAG,EAAE,CAAC,IAAI,CAAA,+CAA+C,CAAC;QAHlE,IAAI,CAAC,gBAAgB,CAAC,WAA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,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(' ') : 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}"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slider.style.d.ts","sourceRoot":"","sources":["../../src/ui/slider.style.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"slider.style.d.ts","sourceRoot":"","sources":["../../src/ui/slider.style.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,KAAK,yBAwDjB,CAAC"}
|
package/dist/ui/slider.style.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { css, unsafeCSS } from 'lit';
|
|
2
2
|
import constants from '../constants';
|
|
3
3
|
export const style = css `
|
|
4
|
+
* {
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
}
|
|
7
|
+
|
|
4
8
|
:host {
|
|
5
9
|
display: block;
|
|
6
10
|
background-color: var(--og-slider-background-color);
|
|
@@ -47,9 +51,8 @@ export const style = css `
|
|
|
47
51
|
.bar-inner {
|
|
48
52
|
width: 100%;
|
|
49
53
|
height: 100%;
|
|
50
|
-
border-width: 3px;
|
|
51
54
|
background-color: var(--og-slider-bar-color);
|
|
52
|
-
|
|
55
|
+
_border: 1px solid #8B8B8B;
|
|
53
56
|
text-align: center;
|
|
54
57
|
border-radius: 6px;
|
|
55
58
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slider.style.js","sourceRoot":"","sources":["../../src/ui/slider.style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACrC,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,MAAM,CAAC,MAAM,KAAK,GAAG,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"slider.style.js","sourceRoot":"","sources":["../../src/ui/slider.style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACrC,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,MAAM,CAAC,MAAM,KAAK,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;WAyBb,SAAS,CAAC,SAAS,CAAC,WAAW,CAAC;;;;;;;;;;;;;;;;YAgB/B,SAAS,CAAC,SAAS,CAAC,WAAW,CAAC;;;;;;;;;;;;;;;CAe3C,CAAC","sourcesContent":["import { css, unsafeCSS } from 'lit';\nimport constants from '../constants';\n\nexport const style = css`\n\t* {\n\t\tbox-sizing: border-box;\n\t}\n\n\t:host {\n\t\tdisplay: block;\n\t\tbackground-color: var(--og-slider-background-color);\n\t\tposition: relative;\n\t\topacity: 0.8;\n\t\ttransition: visibility 0s, opacity 0.1s linear;\n\t\tfont-size: var(--og-font-size);\n\t}\n\n\t:host([hidden]) {\n\t\tvisibility: hidden;\n\t\topacity: 0;\n\t\ttransition: opacity 1s linear, visibility 0s 1s;\n\t}\n\n\t:host([direction=\"vertical\"]) {\n\t\tposition: absolute;\n\t\tright: 0;\n\t\ttop: 0;\n\t\tbottom: 0;\n\t\twidth: ${unsafeCSS(constants.SLIDER_SIZE)}px\n\t}\n\n\t:host([direction=\"vertical\"]) .bar {\n\t\twidth: 100%;\n\t}\n\n\t:host([direction=\"horizontal\"]) .bar {\n\t\theight: 100%;\n\t}\n\n\t:host([direction=\"horizontal\"]) {\n\t\tposition: absolute;\n\t\tright: 0;\n\t\tleft: 0;\n\t\tbottom: 0;\n\t\theight: ${unsafeCSS(constants.SLIDER_SIZE)}px\n\t}\n\n\t.bar {\n\t\tposition: absolute;\n\t}\n\n\t.bar-inner {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tbackground-color: var(--og-slider-bar-color);\n\t\t_border: 1px solid #8B8B8B;\n\t\ttext-align: center;\n\t\tborder-radius: 6px;\n\t}\n`;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omegagrid/core",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.25",
|
|
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.
|
|
39
|
+
"@omegagrid/localize": "^0.9.25",
|
|
40
40
|
"color": "^4.2.3",
|
|
41
41
|
"date-fns": "^3.2.0",
|
|
42
42
|
"lit": "^3.1.1",
|