mirror of
https://github.com/PaddiM8/kalker.git
synced 2024-12-14 02:20:57 +01:00
kalk_web placeholder
This commit is contained in:
parent
a2153d3b16
commit
79facb1bd8
@ -38,6 +38,7 @@ I am not aware of a better way.
|
|||||||
The colours in the component can be changed by using these attributes.
|
The colours in the component can be changed by using these attributes.
|
||||||
```html
|
```html
|
||||||
<kalk-calculator
|
<kalk-calculator
|
||||||
|
hintText="Type something..."
|
||||||
identifierColor="cornflowerblue"
|
identifierColor="cornflowerblue"
|
||||||
operatorColor="darkorange"
|
operatorColor="darkorange"
|
||||||
promptColor="mediumseagreen"
|
promptColor="mediumseagreen"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@paddim8/kalk-component",
|
"name": "@paddim8/kalk-component",
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
"description": "A Svelte component for kalk, a calculator that supports user-defined functions and variables.",
|
"description": "A Svelte component for kalk, a calculator that supports user-defined functions and variables.",
|
||||||
"svelte": "src/main.ts",
|
"svelte": "src/main.ts",
|
||||||
"main": "public/build/bundle.js",
|
"main": "public/build/bundle.js",
|
||||||
@ -60,4 +60,4 @@
|
|||||||
"browserslist": [
|
"browserslist": [
|
||||||
"defaults"
|
"defaults"
|
||||||
]
|
]
|
||||||
}
|
}
|
@ -8,6 +8,7 @@
|
|||||||
export let promptColor = "mediumseagreen";
|
export let promptColor = "mediumseagreen";
|
||||||
export let errorColor = "tomato";
|
export let errorColor = "tomato";
|
||||||
export let linkColor = "cornflowerblue";
|
export let linkColor = "cornflowerblue";
|
||||||
|
export let hintText = "";
|
||||||
|
|
||||||
type Kalk = typeof import("@paddim8/kalk");
|
type Kalk = typeof import("@paddim8/kalk");
|
||||||
|
|
||||||
@ -282,6 +283,13 @@
|
|||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[contenteditable][placeholder]:empty:before {
|
||||||
|
content: attr(placeholder);
|
||||||
|
position: absolute;
|
||||||
|
color: gray;
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<svelte:options tag="kalk-calculator" />
|
<svelte:options tag="kalk-calculator" />
|
||||||
@ -305,6 +313,7 @@
|
|||||||
<div
|
<div
|
||||||
contenteditable="true"
|
contenteditable="true"
|
||||||
class="input"
|
class="input"
|
||||||
|
placeholder={hintText}
|
||||||
on:keydown={(event) => handleKeyDown(event, kalk)}
|
on:keydown={(event) => handleKeyDown(event, kalk)}
|
||||||
on:keyup={handleKeyUp}
|
on:keyup={handleKeyUp}
|
||||||
on:input={handleInput}
|
on:input={handleInput}
|
||||||
|
Loading…
Reference in New Issue
Block a user