@kizmann/nano-ui 0.9.2 → 0.9.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. package/demos/builder.html +401 -0
  2. package/demos/overview.html +1 -1
  3. package/dist/nano-ui.css +1 -1
  4. package/dist/nano-ui.js +3 -3
  5. package/dist/nano-ui.js.map +1 -1
  6. package/dist/themes/light.css +1 -1
  7. package/package.json +2 -2
  8. package/src/config/index.js +6 -0
  9. package/src/config/index.scss +3 -0
  10. package/src/config/src/builder/builder.js +866 -0
  11. package/src/config/src/builder/builder.scss +272 -0
  12. package/src/config/src/builder/prototypes/button/n-button-group.js +11 -0
  13. package/src/config/src/builder/prototypes/button/n-button.js +37 -0
  14. package/src/config/src/builder/prototypes/cascader/n-cascader.js +11 -0
  15. package/src/config/src/builder/prototypes/checkbox/n-checkbox-group.js +11 -0
  16. package/src/config/src/builder/prototypes/checkbox/n-checkbox.js +11 -0
  17. package/src/config/src/builder/prototypes/confirm/n-confirm.js +11 -0
  18. package/src/config/src/builder/prototypes/datepicker/n-datepicker.js +11 -0
  19. package/src/config/src/builder/prototypes/datetimepicker/n-datetimepicker.js +11 -0
  20. package/src/config/src/builder/prototypes/durationpicker/n-durationpicker.js +11 -0
  21. package/src/config/src/builder/prototypes/empty/n-empty.js +11 -0
  22. package/src/config/src/builder/prototypes/form/n-form-group.js +13 -0
  23. package/src/config/src/builder/prototypes/form/n-form-item.js +13 -0
  24. package/src/config/src/builder/prototypes/form/n-form.js +11 -0
  25. package/src/config/src/builder/prototypes/html/div.js +13 -0
  26. package/src/config/src/builder/prototypes/html/nano.js +11 -0
  27. package/src/config/src/builder/prototypes/html/span.js +11 -0
  28. package/src/config/src/builder/prototypes/info/n-info-column.js +11 -0
  29. package/src/config/src/builder/prototypes/info/n-info.js +11 -0
  30. package/src/config/src/builder/prototypes/input/n-input.js +40 -0
  31. package/src/config/src/builder/prototypes/input-number/n-input-number.js +49 -0
  32. package/src/config/src/builder/prototypes/loader/n-loader.js +11 -0
  33. package/src/config/src/builder/prototypes/modal/n-modal.js +11 -0
  34. package/src/config/src/builder/prototypes/popover/n-popover-group.js +11 -0
  35. package/src/config/src/builder/prototypes/popover/n-popover-item.js +11 -0
  36. package/src/config/src/builder/prototypes/popover/n-popover.js +11 -0
  37. package/src/config/src/builder/prototypes/radio/n-radio-group.js +11 -0
  38. package/src/config/src/builder/prototypes/radio/n-radio.js +11 -0
  39. package/src/config/src/builder/prototypes/rating/n-rating.js +11 -0
  40. package/src/config/src/builder/prototypes/select/n-select.js +11 -0
  41. package/src/config/src/builder/prototypes/slider/n-slider.js +11 -0
  42. package/src/config/src/builder/prototypes/switch/n-switch.js +31 -0
  43. package/src/config/src/builder/prototypes/table/n-table-column.js +11 -0
  44. package/src/config/src/builder/prototypes/table/n-table.js +11 -0
  45. package/src/config/src/builder/prototypes/tabs/n-tabs-item.js +11 -0
  46. package/src/config/src/builder/prototypes/tabs/n-tabs.js +11 -0
  47. package/src/config/src/builder/prototypes/tags/n-tags-item.js +11 -0
  48. package/src/config/src/builder/prototypes/tags/n-tags.js +11 -0
  49. package/src/config/src/builder/prototypes/textarea/n-textarea.js +11 -0
  50. package/src/config/src/builder/prototypes/timepicker/n-timepicker.js +11 -0
  51. package/src/config/src/builder/prototypes/transfer/n-transfer.js +11 -0
  52. package/src/config/src/reference-panel/reference-panel.js +196 -0
  53. package/src/config/src/reference-panel/reference-panel.scss +194 -0
  54. package/src/config/src/reference-picker/reference-picker.js +146 -0
  55. package/src/config/src/reference-picker/reference-picker.scss +3 -0
  56. package/src/form/src/form-group/form-group.js +5 -1
  57. package/src/index.scss +1 -0
  58. package/src/input/src/input/input.js +2 -0
  59. package/src/popover/src/popover/popover.scss +3 -3
  60. package/src/root/vars.scss +23 -0
  61. package/webservy.json +3 -1
  62. package/servy.json +0 -6
@@ -0,0 +1,146 @@
1
+ import { Arr, Obj, Any } from "@kizmann/pico-js";
2
+
3
+ export default {
4
+
5
+ name: 'NReferencePicker',
6
+
7
+ props: {
8
+
9
+ modelValue: {
10
+ default()
11
+ {
12
+ return '';
13
+ },
14
+ type: [String]
15
+ },
16
+
17
+ model: {
18
+ default()
19
+ {
20
+ return {};
21
+ },
22
+ type: [Object]
23
+ },
24
+
25
+ scope: {
26
+ default()
27
+ {
28
+ return {};
29
+ },
30
+ type: [Object]
31
+ },
32
+
33
+ size: {
34
+ default()
35
+ {
36
+ return 'md';
37
+ },
38
+ type: [String]
39
+ },
40
+
41
+ width: {
42
+ default()
43
+ {
44
+ return '100%';
45
+ },
46
+ type: [String]
47
+ },
48
+
49
+ height: {
50
+ default()
51
+ {
52
+ return '100%';
53
+ },
54
+ type: [String]
55
+ },
56
+
57
+ },
58
+
59
+ data()
60
+ {
61
+ return {
62
+ modal: false, tempValue: this.modelValue
63
+ };
64
+ },
65
+
66
+ methods: {
67
+
68
+ updateValue(value)
69
+ {
70
+ this.$emit('update:modelValue', this.tempValue = value);
71
+ }
72
+
73
+ },
74
+
75
+ renderModal()
76
+ {
77
+ if ( ! this.modal ) {
78
+ return null;
79
+ }
80
+
81
+ let modalProps = {
82
+ modelValue: true,
83
+ width: this.width,
84
+ height: this.height,
85
+ };
86
+
87
+ modalProps['onClose'] = () => {
88
+ this.modal = false;
89
+ };
90
+
91
+ let panelProps = {
92
+ model: this.model, scope: this.scope,
93
+ };
94
+
95
+ panelProps['onUpdate:modelValue'] = (value) => {
96
+ this.updateValue(value); this.modal = false;
97
+ };
98
+
99
+ let slots = {
100
+ //
101
+ };
102
+
103
+ slots['body'] = () => (
104
+ <NReferencePanel class="in-modal" {...panelProps} />
105
+ );
106
+
107
+ return (
108
+ <NModal {...modalProps} v-slots={slots} />
109
+ );
110
+ },
111
+
112
+ renderInput()
113
+ {
114
+ let inputProps = {
115
+ modelValue: this.tempValue,
116
+ icon: 'fa fa-expand',
117
+ size: this.size,
118
+ };
119
+
120
+ inputProps['onUpdate:modelValue'] = (value) => {
121
+ this.updateValue(value);
122
+ };
123
+
124
+ inputProps['onBlur'] = (e) => {
125
+ this.$emit('onBlur', e);
126
+ };
127
+
128
+ inputProps['onIconClick'] = () => {
129
+ this.modal = true;
130
+ };
131
+
132
+ return (
133
+ <NInput {...inputProps} />
134
+ );
135
+ },
136
+
137
+ render()
138
+ {
139
+ return (
140
+ <div class="n-reference-picker">
141
+ {[this.ctor('renderInput')(), this.ctor('renderModal')()]}
142
+ </div>
143
+ );
144
+ }
145
+
146
+ }
@@ -0,0 +1,3 @@
1
+ .n-reference-picker .n-input input {
2
+ font-family: monospace;
3
+ }
@@ -201,7 +201,11 @@ export default {
201
201
 
202
202
  render()
203
203
  {
204
- let size = this.size || this.NForm.size;
204
+ let size = this.size ;
205
+
206
+ if ( this.NForm ) {
207
+ size = size || this.NForm.size;
208
+ }
205
209
 
206
210
  let classList = [
207
211
  'n-form-group',
package/src/index.scss CHANGED
@@ -36,4 +36,5 @@
36
36
  @import "./map/index";
37
37
  @import "./preview/index";
38
38
  @import "./rating/index";
39
+ @import "./config/index";
39
40
 
@@ -156,11 +156,13 @@ export default {
156
156
  onFocus(event)
157
157
  {
158
158
  this.focus = true;
159
+ this.$emit('focus', event);
159
160
  },
160
161
 
161
162
  onBlur(event)
162
163
  {
163
164
  this.focus = false;
165
+ this.$emit('blur', event);
164
166
  }
165
167
 
166
168
  },
@@ -68,7 +68,6 @@
68
68
  line-height: 1.2;
69
69
  }
70
70
 
71
-
72
71
  .n-popover-option .n-image {
73
72
  flex: 0 0 auto;
74
73
  margin-top: -2px;
@@ -139,6 +138,7 @@
139
138
 
140
139
  .n-popover--#{$suffix} .n-popover__body .n-popover-group,
141
140
  .n-popover--#{$suffix} .n-popover__body .n-popover-option {
141
+ width: calc(100% + #{$-popover-padding * 2.4});
142
142
  margin: 0 -#{$-popover-padding * 1.2};
143
143
  }
144
144
 
@@ -153,8 +153,8 @@
153
153
  }
154
154
 
155
155
  .n-popover-option--#{$suffix} .n-image {
156
- width: $-popover-font + 6;
157
- height: $-popover-font + 6;
156
+ width: $-popover-font + 10;
157
+ height: $-popover-font + 10;
158
158
  }
159
159
 
160
160
  .n-popover-option--#{$suffix} .n-icon {
@@ -158,3 +158,26 @@ $colors: (
158
158
  'dark': $color-danger-dark
159
159
  ),
160
160
  ) !default;
161
+
162
+ $colors-tags: (
163
+ '0': mix($color-secondary, $color-secondary, 65%),
164
+ '1': mix($color-primary, $color-secondary, 65%),
165
+ '2': mix($color-danger, $color-secondary, 65%),
166
+ '3': mix($color-success, $color-secondary, 65%),
167
+ '4': mix($color-warning, $color-secondary, 65%),
168
+ '5': mix($color-primary, $color-success, 65%),
169
+ '6': mix($color-secondary, $color-success, 65%),
170
+ '7': mix($color-danger, $color-success, 65%),
171
+ '8': mix($color-success, $color-success, 65%),
172
+ '9': mix($color-warning, $color-success, 65%),
173
+ '10': mix($color-primary, $color-danger, 65%),
174
+ '11': mix($color-secondary, $color-danger, 65%),
175
+ '12': mix($color-danger, $color-danger, 65%),
176
+ '13': mix($color-success, $color-danger, 65%),
177
+ '14': mix($color-warning, $color-danger, 65%),
178
+ '15': mix($color-primary, $color-warning, 65%),
179
+ '16': mix($color-secondary, $color-warning, 65%),
180
+ '17': mix($color-danger, $color-warning, 65%),
181
+ '18': mix($color-success, $color-warning, 65%),
182
+ '19': mix($color-warning, $color-warning, 65%),
183
+ ) !default;
package/webservy.json CHANGED
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "hostname": "nano-ui.local",
3
3
  "webroot": "",
4
- "engine": "apache",
4
+ "engine": "httpd",
5
+ "type": "default",
6
+ "proxy": "",
5
7
  "version": "php-8.2.8"
6
8
  }
package/servy.json DELETED
@@ -1,6 +0,0 @@
1
- {
2
- "hostname": "nano-ui.local",
3
- "webroot": "",
4
- "version": "php-8.2.8",
5
- "engine": "apache"
6
- }