not-bulma 1.2.36 → 1.2.38

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "not-bulma",
3
- "version": "1.2.36",
3
+ "version": "1.2.38",
4
4
  "description": "not-* family UI components on Bulma CSS Framework",
5
5
  "main": "src/index.js",
6
6
  "svelte": "src/index.js",
@@ -2,6 +2,7 @@ import UIAutocomplete from "./ui.autocomplete.svelte";
2
2
  import UICheckbox from "./ui.checkbox.svelte";
3
3
  import UICheckboxList from "./ui.checkbox.list.svelte";
4
4
  import UIColor from "./ui.color.svelte";
5
+ import UIControl from "./ui.control.svelte";
5
6
  import UIDate from "./ui.date.svelte";
6
7
  import UIDatetimeInTZ from "./ui.datetime.in.tz.svelte";
7
8
  import UIEmail from "./ui.email.svelte";
@@ -27,6 +28,7 @@ export {
27
28
  UICheckbox,
28
29
  UICheckboxList,
29
30
  UIColor,
31
+ UIControl,
30
32
  UIDate,
31
33
  UIDatetimeInTZ,
32
34
  UIEmail,
@@ -0,0 +1,5 @@
1
+ <script>
2
+ export let classes = "";
3
+ </script>
4
+
5
+ <div class="control {classes}"><slot /></div>
@@ -1,6 +1,7 @@
1
1
  import UIBoolean from "./ui.boolean.svelte";
2
2
  import UIBooleanLabeled from "./ui.boolean.labeled.svelte";
3
3
  import UIBooleans from "./ui.booleans.svelte";
4
+ import UICensored from "./ui.censored.svelte";
4
5
  import UIIndicator from "./ui.indicator.svelte";
5
6
  import UILoader from "./ui.loader.svelte";
6
7
  import UISelectFromModelOnDemandInline from "./ui.select.from.model.on.demand.inline.svelte";
@@ -18,6 +19,7 @@ export {
18
19
  UIBoolean,
19
20
  UIBooleanLabeled,
20
21
  UIBooleans,
22
+ UICensored,
21
23
  UIErrorsList,
22
24
  UIIndicator,
23
25
  UILoader,
@@ -0,0 +1,39 @@
1
+ <script>
2
+ export let hidden = true;
3
+ export let showable = true;
4
+ export let copiable = true;
5
+
6
+ export let copyIcon = "copy";
7
+ export let showIcon = "eye";
8
+ export let hideIcon = "eye-slash";
9
+
10
+ export let value = "";
11
+
12
+ function toggleView() {
13
+ hidden != hidden;
14
+ }
15
+
16
+ async function copyContent() {
17
+ try {
18
+ await navigator.clipboard.writeText(value);
19
+ } catch (err) {
20
+ console.error("Failed to copy: ", err);
21
+ }
22
+ }
23
+ </script>
24
+
25
+ <span
26
+ class={hidden ? "is-censored has-background-primary-90" : ""}
27
+ style={hidden ? "width: {value.length}rem;" : ""}
28
+ >{hidden ? "" : value}</span
29
+ >
30
+ {#if copiable}
31
+ <span on:click={copyContent} class="icon is-small is-right"
32
+ ><i class="fas fa-{copyIcon}" /></span
33
+ >
34
+ {/if}
35
+ {#if showable}
36
+ <span class="icon is-small is-right" on:click={toggleView}
37
+ ><i class="fas fa-{hidden ? showIcon : hideIcon}" /></span
38
+ >
39
+ {/if}
@@ -26,7 +26,7 @@
26
26
  export let serviceName = "";
27
27
  /**
28
28
  * Set this
29
- * @property {string} serviceName method of service to open modal with selector
29
+ * @property {string} serviceOpenSelectorMethod method of service to open modal with selector
30
30
  */
31
31
  export let serviceOpenSelectorMethod = "openSelector";
32
32
  /**
@@ -24,17 +24,6 @@ export default class notServiceModelSearch {
24
24
  delete this.app;
25
25
  }
26
26
 
27
- augmentValidators(validators) {
28
- return Builder(validators, () => this.getValidatorEnv());
29
- }
30
-
31
- getValidatorEnv() {
32
- return {
33
- config: this.app.getConfigReaderForModule(this.modelName),
34
- validator: Validator,
35
- };
36
- }
37
-
38
27
  getSearchRouteName() {
39
28
  return "listAndCount";
40
29
  }
@@ -1,3 +1,5 @@
1
+ @import "bulma/sass/utilities/mixins.scss";
2
+
1
3
  .is-pointable {
2
4
  cursor: pointer;
3
5
  }
@@ -5,3 +7,8 @@
5
7
  .is-title-icon {
6
8
  padding-right: 0.3rem;
7
9
  }
10
+
11
+ .is-censored {
12
+ display: inline-block;
13
+ border-radius: 0.3rem;
14
+ }