nexa-ui-kit 0.9.0 → 0.11.0
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/components/NAlert.js +48 -27
- package/dist/components/NAlert.nexa +12 -6
- package/dist/components/NAutocomplete.js +24 -19
- package/dist/components/NAutocomplete.nexa +3 -3
- package/dist/components/NBottomSheet.js +17 -17
- package/dist/components/NBottomSheet.nexa +2 -2
- package/dist/components/NButton.js +58 -58
- package/dist/components/NButton.nexa +10 -9
- package/dist/components/NCard.js +1 -1
- package/dist/components/NCard.nexa +1 -1
- package/dist/components/NCheckbox.js +22 -18
- package/dist/components/NCheckbox.nexa +2 -1
- package/dist/components/NChips.js +12 -9
- package/dist/components/NChips.nexa +1 -1
- package/dist/components/NDataTable.js +359 -41
- package/dist/components/NDataTable.nexa +318 -10
- package/dist/components/NDatepicker.js +51 -42
- package/dist/components/NDatepicker.nexa +3 -3
- package/dist/components/NInput.js +50 -40
- package/dist/components/NInput.nexa +4 -3
- package/dist/components/NInputNumber.js +17 -12
- package/dist/components/NInputNumber.nexa +2 -2
- package/dist/components/NModal.js +33 -27
- package/dist/components/NModal.nexa +4 -4
- package/dist/components/NMultiSelect.js +46 -37
- package/dist/components/NMultiSelect.nexa +3 -3
- package/dist/components/NPaginator.js +28 -20
- package/dist/components/NPaginator.nexa +4 -4
- package/dist/components/NPassword.js +60 -46
- package/dist/components/NPassword.nexa +5 -4
- package/dist/components/NProgressBar.js +4 -4
- package/dist/components/NProgressBar.nexa +4 -4
- package/dist/components/NSelect.js +67 -62
- package/dist/components/NSelect.nexa +4 -4
- package/dist/components/NTag.js +26 -23
- package/dist/components/NTag.nexa +6 -6
- package/dist/components/NToastContainer.js +64 -48
- package/dist/components/NToastContainer.nexa +6 -3
- package/dist/components/NTreeMenu.js +23 -21
- package/dist/components/NTreeMenu.nexa +1 -1
- package/dist/styles/tokens.css +18 -0
- package/package.json +4 -4
- package/src/components/NAlert.nexa +12 -6
- package/src/components/NAutocomplete.nexa +3 -3
- package/src/components/NBottomSheet.nexa +2 -2
- package/src/components/NButton.nexa +10 -9
- package/src/components/NCard.nexa +1 -1
- package/src/components/NCheckbox.nexa +2 -1
- package/src/components/NChips.nexa +1 -1
- package/src/components/NDataTable.nexa +318 -10
- package/src/components/NDatepicker.nexa +3 -3
- package/src/components/NInput.nexa +4 -3
- package/src/components/NInputNumber.nexa +2 -2
- package/src/components/NModal.nexa +4 -4
- package/src/components/NMultiSelect.nexa +3 -3
- package/src/components/NPaginator.nexa +4 -4
- package/src/components/NPassword.nexa +5 -4
- package/src/components/NProgressBar.nexa +4 -4
- package/src/components/NSelect.nexa +4 -4
- package/src/components/NTag.nexa +6 -6
- package/src/components/NToastContainer.nexa +6 -3
- package/src/components/NTreeMenu.nexa +1 -1
- package/src/styles/tokens.css +18 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { signal, computed, inject, effect, h, hText, defineComponent, registerComponent, reloadComponent, injectStyle } from 'nexa-framework'
|
|
2
2
|
|
|
3
3
|
const _sfc_main = defineComponent({
|
|
4
|
-
__scopeId: 'data-v-
|
|
4
|
+
__scopeId: 'data-v-5b5ed8a8',
|
|
5
5
|
__hmrId: 'NInput_nexa',
|
|
6
6
|
props: {
|
|
7
7
|
modelValue: { type: [String, Number], default: '' },
|
|
@@ -106,43 +106,53 @@ const _sfc_main = defineComponent({
|
|
|
106
106
|
// Injected render function
|
|
107
107
|
_sfc_main.render = function(ctx) {
|
|
108
108
|
let { field, showPassword, isFocused, effectiveValue, draft, effectiveId, effectiveDescribedBy, effectiveInvalid, effectiveError, effectiveDisabled, inputType, currentLength, onInput, onFocus, onBlur, clear, togglePassword, inject, $slots, emit, modelValue, type, placeholder, label, error, id, name, autocomplete, ariaDescribedby, ariaInvalid, bindField, disabled, readonly, clearable, maxlength, prefixIcon, suffixIcon, Fragment: _ntc_Fragment } = ctx
|
|
109
|
-
return h('div', { class: "n-input-group", "data-v-
|
|
109
|
+
return h('div', { class: "n-input-group", "data-v-5b5ed8a8": "" }, [
|
|
110
110
|
"\n ",
|
|
111
|
-
(label) ? h('label', { class: "n-input-label", "data-v-
|
|
111
|
+
(label) ? h('label', { class: "n-input-label", "data-v-5b5ed8a8": "" }, [
|
|
112
112
|
label
|
|
113
113
|
]) : null,
|
|
114
|
-
h('div', { class: ["n-input-wrapper", { 'is-focused': isFocused.value, 'has-error': effectiveError.value, 'is-disabled': effectiveDisabled.value }], "data-v-
|
|
114
|
+
h('div', { class: ["n-input-wrapper", { 'is-focused': isFocused.value, 'has-error': effectiveError.value, 'is-disabled': effectiveDisabled.value }], "data-v-5b5ed8a8": "" }, [
|
|
115
115
|
"\n ",
|
|
116
|
-
(prefixIcon) ? h('span', { class: "n-input-icon is-prefix", "data-v-
|
|
116
|
+
(prefixIcon) ? h('span', { class: "n-input-icon is-prefix", "data-v-5b5ed8a8": "" }, [
|
|
117
117
|
prefixIcon
|
|
118
118
|
]) : null,
|
|
119
|
-
h('input', { class: ["n-input", { 'has-prefix': !!prefixIcon, 'has-suffix': !!suffixIcon || clearable || type === 'password' }], id: effectiveId.value || undefined, name: name || undefined, type: inputType.value, value: draft.value, placeholder: placeholder, disabled: effectiveDisabled.value, readonly: readonly, autocomplete: autocomplete || undefined, "aria-describedby": effectiveDescribedBy.value || undefined, "aria-invalid": effectiveInvalid.value || undefined, maxlength: maxlength || undefined, onInput: onInput, onFocus: onFocus, onBlur: onBlur, "data-v-
|
|
119
|
+
h('input', { class: ["n-input", { 'has-prefix': !!prefixIcon, 'has-suffix': !!suffixIcon || clearable || type === 'password' }], id: effectiveId.value || undefined, name: name || undefined, type: inputType.value, value: draft.value, placeholder: placeholder, disabled: effectiveDisabled.value, readonly: readonly, autocomplete: autocomplete || undefined, "aria-describedby": effectiveDescribedBy.value || undefined, "aria-invalid": effectiveInvalid.value || undefined, maxlength: maxlength || undefined, onInput: onInput, onFocus: onFocus, onBlur: onBlur, "data-v-5b5ed8a8": "" }),
|
|
120
120
|
"\n ",
|
|
121
|
-
h('div', { class: "n-input-focus-ring", "data-v-
|
|
121
|
+
h('div', { class: "n-input-focus-ring", "data-v-5b5ed8a8": "" }),
|
|
122
122
|
"\n ",
|
|
123
|
-
h('div', { class: "n-input-actions", "data-v-
|
|
123
|
+
h('div', { class: "n-input-actions", "data-v-5b5ed8a8": "" }, [
|
|
124
124
|
"\n ",
|
|
125
|
-
(clearable && draft.value) ? h('button', { class: "n-input-action", onClick: clear, tabindex: "-1", type: "button", "data-v-
|
|
126
|
-
"
|
|
125
|
+
(clearable && draft.value) ? h('button', { class: "n-input-action", onClick: clear, tabindex: "-1", type: "button", "aria-label": "Clear", "data-v-5b5ed8a8": "" }, [
|
|
126
|
+
h('svg', { viewBox: "0 0 24 24", width: "14", height: "14", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", focusable: "false", "aria-hidden": "true", "data-v-5b5ed8a8": "" }, [
|
|
127
|
+
h('path', { d: "M18 6L6 18", "data-v-5b5ed8a8": "" }),
|
|
128
|
+
h('path', { d: "M6 6l12 12", "data-v-5b5ed8a8": "" })
|
|
129
|
+
])
|
|
127
130
|
]) : null,
|
|
128
|
-
(type === 'password') ? h('button', { class: "n-input-action", onClick: togglePassword, tabindex: "-1", type: "button", "data-v-
|
|
131
|
+
(type === 'password') ? h('button', { class: "n-input-action", onClick: togglePassword, tabindex: "-1", type: "button", "aria-label": showPassword.value ? 'Hide password' : 'Show password', "data-v-5b5ed8a8": "" }, [
|
|
129
132
|
"\n ",
|
|
130
|
-
showPassword.value ? '
|
|
133
|
+
(!showPassword.value) ? h('svg', { viewBox: "0 0 24 24", width: "16", height: "16", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", focusable: "false", "aria-hidden": "true", "data-v-5b5ed8a8": "" }, [
|
|
134
|
+
h('path', { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z", "data-v-5b5ed8a8": "" }),
|
|
135
|
+
h('circle', { cx: "12", cy: "12", r: "3", "data-v-5b5ed8a8": "" })
|
|
136
|
+
]) : (true) ? h('svg', { viewBox: "0 0 24 24", width: "16", height: "16", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", focusable: "false", "aria-hidden": "true", "data-v-5b5ed8a8": "" }, [
|
|
137
|
+
h('path', { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z", "data-v-5b5ed8a8": "" }),
|
|
138
|
+
h('circle', { cx: "12", cy: "12", r: "3", "data-v-5b5ed8a8": "" }),
|
|
139
|
+
h('path', { d: "M23 1L1 23", "data-v-5b5ed8a8": "" })
|
|
140
|
+
]) : null,
|
|
131
141
|
"\n "
|
|
132
142
|
]) : null,
|
|
133
|
-
(suffixIcon) ? h('span', { class: "n-input-icon is-suffix", "data-v-
|
|
143
|
+
(suffixIcon) ? h('span', { class: "n-input-icon is-suffix", "data-v-5b5ed8a8": "" }, [
|
|
134
144
|
suffixIcon
|
|
135
145
|
]) : null
|
|
136
146
|
]),
|
|
137
147
|
"\n "
|
|
138
148
|
]),
|
|
139
149
|
"\n ",
|
|
140
|
-
h('div', { class: "n-input-bottom", "data-v-
|
|
150
|
+
h('div', { class: "n-input-bottom", "data-v-5b5ed8a8": "" }, [
|
|
141
151
|
"\n ",
|
|
142
|
-
(effectiveError.value) ? h('span', { class: "n-input-error-msg", "data-v-
|
|
152
|
+
(effectiveError.value) ? h('span', { class: "n-input-error-msg", "data-v-5b5ed8a8": "" }, [
|
|
143
153
|
effectiveError.value
|
|
144
154
|
]) : null,
|
|
145
|
-
(maxlength > 0) ? h('span', { class: "n-input-counter", "data-v-
|
|
155
|
+
(maxlength > 0) ? h('span', { class: "n-input-counter", "data-v-5b5ed8a8": "" }, [
|
|
146
156
|
currentLength.value,
|
|
147
157
|
"/",
|
|
148
158
|
maxlength
|
|
@@ -151,33 +161,33 @@ _sfc_main.render = function(ctx) {
|
|
|
151
161
|
"\n "
|
|
152
162
|
])
|
|
153
163
|
}
|
|
154
|
-
_sfc_main.__scopeId = 'data-v-
|
|
164
|
+
_sfc_main.__scopeId = 'data-v-5b5ed8a8'
|
|
155
165
|
_sfc_main.__hmrId = 'NInput_nexa'
|
|
156
166
|
|
|
157
167
|
export default _sfc_main
|
|
158
168
|
|
|
159
|
-
const __style = `.n-input-group[data-v-
|
|
169
|
+
const __style = `.n-input-group[data-v-5b5ed8a8]{
|
|
160
170
|
display: flex;
|
|
161
171
|
flex-direction: column;
|
|
162
172
|
gap: var(--n-space-2);
|
|
163
173
|
width: 100%;
|
|
164
174
|
}
|
|
165
175
|
|
|
166
|
-
.n-input-label[data-v-
|
|
176
|
+
.n-input-label[data-v-5b5ed8a8]{
|
|
167
177
|
font-size: var(--n-text-sm);
|
|
168
178
|
font-weight: var(--n-weight-semibold);
|
|
169
179
|
color: var(--n-color-text-secondary);
|
|
170
180
|
margin-left: var(--n-space-1);
|
|
171
181
|
}
|
|
172
182
|
|
|
173
|
-
.n-input-wrapper[data-v-
|
|
183
|
+
.n-input-wrapper[data-v-5b5ed8a8]{
|
|
174
184
|
position: relative;
|
|
175
185
|
display: flex;
|
|
176
186
|
align-items: center;
|
|
177
187
|
transition: all var(--n-transition-fast);
|
|
178
188
|
}
|
|
179
189
|
|
|
180
|
-
.n-input[data-v-
|
|
190
|
+
.n-input[data-v-5b5ed8a8]{
|
|
181
191
|
position: relative;
|
|
182
192
|
z-index: 1;
|
|
183
193
|
width: 100%;
|
|
@@ -195,19 +205,19 @@ const __style = `.n-input-group[data-v-7dbed0f8]{
|
|
|
195
205
|
outline: none;
|
|
196
206
|
}
|
|
197
207
|
|
|
198
|
-
.n-input.has-prefix[data-v-
|
|
208
|
+
.n-input.has-prefix[data-v-5b5ed8a8]{
|
|
199
209
|
padding-left: 2.5rem;
|
|
200
210
|
}
|
|
201
211
|
|
|
202
|
-
.n-input.has-suffix[data-v-
|
|
212
|
+
.n-input.has-suffix[data-v-5b5ed8a8]{
|
|
203
213
|
padding-right: 2.5rem;
|
|
204
214
|
}
|
|
205
215
|
|
|
206
|
-
.n-input[data-v-
|
|
216
|
+
.n-input[data-v-5b5ed8a8]::placeholder{
|
|
207
217
|
color: var(--n-color-text-muted);
|
|
208
218
|
}
|
|
209
219
|
|
|
210
|
-
.n-input-focus-ring[data-v-
|
|
220
|
+
.n-input-focus-ring[data-v-5b5ed8a8]{
|
|
211
221
|
position: absolute;
|
|
212
222
|
inset: 0;
|
|
213
223
|
border-radius: var(--n-radius-md);
|
|
@@ -218,25 +228,25 @@ const __style = `.n-input-group[data-v-7dbed0f8]{
|
|
|
218
228
|
z-index: 0;
|
|
219
229
|
}
|
|
220
230
|
|
|
221
|
-
.is-focused .n-input-focus-ring[data-v-
|
|
231
|
+
.is-focused .n-input-focus-ring[data-v-5b5ed8a8]{
|
|
222
232
|
opacity: 0.35;
|
|
223
233
|
}
|
|
224
234
|
|
|
225
|
-
.is-focused .n-input[data-v-
|
|
235
|
+
.is-focused .n-input[data-v-5b5ed8a8]{
|
|
226
236
|
border-color: var(--n-color-primary);
|
|
227
237
|
background: var(--n-color-surface);
|
|
228
238
|
}
|
|
229
239
|
|
|
230
|
-
.has-error .n-input[data-v-
|
|
240
|
+
.has-error .n-input[data-v-5b5ed8a8]{
|
|
231
241
|
border-color: var(--n-color-danger);
|
|
232
242
|
}
|
|
233
243
|
|
|
234
|
-
.has-error .n-input-focus-ring[data-v-
|
|
244
|
+
.has-error .n-input-focus-ring[data-v-5b5ed8a8]{
|
|
235
245
|
background: var(--n-color-danger);
|
|
236
246
|
opacity: 0.35;
|
|
237
247
|
}
|
|
238
248
|
|
|
239
|
-
.n-input-icon[data-v-
|
|
249
|
+
.n-input-icon[data-v-5b5ed8a8]{
|
|
240
250
|
position: absolute;
|
|
241
251
|
top: 50%;
|
|
242
252
|
transform: translateY(-50%);
|
|
@@ -248,15 +258,15 @@ const __style = `.n-input-group[data-v-7dbed0f8]{
|
|
|
248
258
|
line-height: 1;
|
|
249
259
|
}
|
|
250
260
|
|
|
251
|
-
.n-input-icon.is-prefix[data-v-
|
|
261
|
+
.n-input-icon.is-prefix[data-v-5b5ed8a8]{
|
|
252
262
|
left: 0.85rem;
|
|
253
263
|
}
|
|
254
264
|
|
|
255
|
-
.n-input-icon.is-suffix[data-v-
|
|
265
|
+
.n-input-icon.is-suffix[data-v-5b5ed8a8]{
|
|
256
266
|
right: 0.85rem;
|
|
257
267
|
}
|
|
258
268
|
|
|
259
|
-
.n-input-actions[data-v-
|
|
269
|
+
.n-input-actions[data-v-5b5ed8a8]{
|
|
260
270
|
position: absolute;
|
|
261
271
|
right: 0.5rem;
|
|
262
272
|
top: 50%;
|
|
@@ -266,7 +276,7 @@ const __style = `.n-input-group[data-v-7dbed0f8]{
|
|
|
266
276
|
gap: 0.15rem;
|
|
267
277
|
}
|
|
268
278
|
|
|
269
|
-
.n-input-action[data-v-
|
|
279
|
+
.n-input-action[data-v-5b5ed8a8]{
|
|
270
280
|
background: transparent;
|
|
271
281
|
border: none;
|
|
272
282
|
color: var(--n-color-text-muted);
|
|
@@ -280,32 +290,32 @@ const __style = `.n-input-group[data-v-7dbed0f8]{
|
|
|
280
290
|
line-height: 1;
|
|
281
291
|
}
|
|
282
292
|
|
|
283
|
-
.n-input-action[data-v-
|
|
293
|
+
.n-input-action[data-v-5b5ed8a8]:hover{
|
|
284
294
|
color: var(--n-color-text);
|
|
285
295
|
background: var(--n-color-glass);
|
|
286
296
|
}
|
|
287
297
|
|
|
288
|
-
.n-input-bottom[data-v-
|
|
298
|
+
.n-input-bottom[data-v-5b5ed8a8]{
|
|
289
299
|
display: flex;
|
|
290
300
|
justify-content: space-between;
|
|
291
301
|
align-items: center;
|
|
292
302
|
padding: 0 var(--n-space-1);
|
|
293
303
|
}
|
|
294
304
|
|
|
295
|
-
.n-input-error-msg[data-v-
|
|
305
|
+
.n-input-error-msg[data-v-5b5ed8a8]{
|
|
296
306
|
font-size: var(--n-text-xs);
|
|
297
307
|
color: var(--n-color-danger);
|
|
298
308
|
}
|
|
299
309
|
|
|
300
|
-
.n-input-counter[data-v-
|
|
310
|
+
.n-input-counter[data-v-5b5ed8a8]{
|
|
301
311
|
font-size: var(--n-text-xs);
|
|
302
312
|
color: var(--n-color-text-muted);
|
|
303
313
|
margin-left: auto;
|
|
304
314
|
}
|
|
305
315
|
|
|
306
|
-
.is-disabled .n-input[data-v-
|
|
316
|
+
.is-disabled .n-input[data-v-5b5ed8a8]{
|
|
307
317
|
opacity: 0.5;
|
|
308
318
|
cursor: not-allowed;
|
|
309
319
|
background: var(--n-color-surface-alt);
|
|
310
320
|
}`
|
|
311
|
-
injectStyle('data-v-
|
|
321
|
+
injectStyle('data-v-5b5ed8a8', __style)
|
|
@@ -141,9 +141,10 @@ const togglePassword = () => {
|
|
|
141
141
|
/>
|
|
142
142
|
<div class="n-input-focus-ring"></div>
|
|
143
143
|
<div class="n-input-actions">
|
|
144
|
-
<button v-if="clearable && draft.value" class="n-input-action" @click="clear" tabindex="-1" type="button"
|
|
145
|
-
<button v-if="type === 'password'" class="n-input-action" @click="togglePassword" tabindex="-1" type="button">
|
|
146
|
-
|
|
144
|
+
<button v-if="clearable && draft.value" class="n-input-action" @click="clear" tabindex="-1" type="button" aria-label="Clear"><svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" focusable="false" aria-hidden="true"><path d="M18 6L6 18"/><path d="M6 6l12 12"/></svg></button>
|
|
145
|
+
<button v-if="type === 'password'" class="n-input-action" @click="togglePassword" tabindex="-1" type="button" :aria-label="showPassword.value ? 'Hide password' : 'Show password'">
|
|
146
|
+
<svg v-if="!showPassword.value" viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" focusable="false" aria-hidden="true"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/></svg>
|
|
147
|
+
<svg v-else viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" focusable="false" aria-hidden="true"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/><path d="M23 1L1 23"/></svg>
|
|
147
148
|
</button>
|
|
148
149
|
<span v-if="suffixIcon" class="n-input-icon is-suffix">{{ suffixIcon }}</span>
|
|
149
150
|
</div>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { signal, computed, inject, effect, batch, h, hText, defineComponent, registerComponent, reloadComponent, injectStyle } from 'nexa-framework'
|
|
2
2
|
|
|
3
3
|
const _sfc_main = defineComponent({
|
|
4
|
-
__scopeId: 'data-v-
|
|
4
|
+
__scopeId: 'data-v-6f989f3f',
|
|
5
5
|
__hmrId: 'NInputNumber_nexa',
|
|
6
6
|
props: {
|
|
7
7
|
modelValue: { type: Number, default: 0 },
|
|
@@ -201,31 +201,36 @@ const _sfc_main = defineComponent({
|
|
|
201
201
|
// Injected render function
|
|
202
202
|
_sfc_main.render = function(ctx) {
|
|
203
203
|
let { field, effectiveValue, effectiveDisabled, text, canEdit, isFocused, nfSignal, displayText, sanitize, clamp, parse, setValue, inc, dec, onInput, onBeforeInput, onPaste, onKeydown, onBlur, onFocus, inject, batch, $slots, emit, modelValue, min, max, step, bindField, disabled, readonly, label, placeholder, currency, locale, Fragment: _ntc_Fragment } = ctx
|
|
204
|
-
return h('div', { class: "n-inum", "data-v-
|
|
204
|
+
return h('div', { class: "n-inum", "data-v-6f989f3f": "" }, [
|
|
205
205
|
"\r\n ",
|
|
206
|
-
(label) ? h('label', { class: "n-inum-label", "data-v-
|
|
206
|
+
(label) ? h('label', { class: "n-inum-label", "data-v-6f989f3f": "" }, [
|
|
207
207
|
label
|
|
208
208
|
]) : null,
|
|
209
|
-
h('div', { class: ["n-inum-wrap", { 'is-disabled': effectiveDisabled.value }], "data-v-
|
|
209
|
+
h('div', { class: ["n-inum-wrap", { 'is-disabled': effectiveDisabled.value }], "data-v-6f989f3f": "" }, [
|
|
210
210
|
"\r\n ",
|
|
211
|
-
h('button', { class: "n-inum-btn n-inum-dec", type: "button", disabled: effectiveDisabled.value || readonly, "aria-label": "Decrement", onClick: dec, "data-v-
|
|
212
|
-
"
|
|
211
|
+
h('button', { class: "n-inum-btn n-inum-dec", type: "button", disabled: effectiveDisabled.value || readonly, "aria-label": "Decrement", onClick: dec, "data-v-6f989f3f": "" }, [
|
|
212
|
+
h('svg', { viewBox: "0 0 24 24", width: "16", height: "16", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", focusable: "false", "aria-hidden": "true", "data-v-6f989f3f": "" }, [
|
|
213
|
+
h('line', { x1: "5", y1: "12", x2: "19", y2: "12", "data-v-6f989f3f": "" })
|
|
214
|
+
])
|
|
213
215
|
]),
|
|
214
216
|
"\r\n ",
|
|
215
|
-
h('input', { class: "n-inum-input", type: "text", value: displayText.value, placeholder: placeholder, disabled: effectiveDisabled.value, readonly: readonly, inputmode: "decimal", autocomplete: "off", onBeforeinput: onBeforeInput, onKeydown: onKeydown, onPaste: onPaste, onInput: onInput, onFocus: onFocus, onBlur: onBlur, "data-v-
|
|
217
|
+
h('input', { class: "n-inum-input", type: "text", value: displayText.value, placeholder: placeholder, disabled: effectiveDisabled.value, readonly: readonly, inputmode: "decimal", autocomplete: "off", onBeforeinput: onBeforeInput, onKeydown: onKeydown, onPaste: onPaste, onInput: onInput, onFocus: onFocus, onBlur: onBlur, "data-v-6f989f3f": "" }),
|
|
216
218
|
"\r\n ",
|
|
217
|
-
h('button', { class: "n-inum-btn n-inum-inc", type: "button", disabled: effectiveDisabled.value || readonly, "aria-label": "Increment", onClick: inc, "data-v-
|
|
218
|
-
"
|
|
219
|
+
h('button', { class: "n-inum-btn n-inum-inc", type: "button", disabled: effectiveDisabled.value || readonly, "aria-label": "Increment", onClick: inc, "data-v-6f989f3f": "" }, [
|
|
220
|
+
h('svg', { viewBox: "0 0 24 24", width: "16", height: "16", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", focusable: "false", "aria-hidden": "true", "data-v-6f989f3f": "" }, [
|
|
221
|
+
h('line', { x1: "12", y1: "5", x2: "12", y2: "19", "data-v-6f989f3f": "" }),
|
|
222
|
+
h('line', { x1: "5", y1: "12", x2: "19", y2: "12", "data-v-6f989f3f": "" })
|
|
223
|
+
])
|
|
219
224
|
]),
|
|
220
225
|
"\r\n "
|
|
221
226
|
]),
|
|
222
227
|
"\r\n "
|
|
223
228
|
])
|
|
224
229
|
}
|
|
225
|
-
_sfc_main.__scopeId = 'data-v-
|
|
230
|
+
_sfc_main.__scopeId = 'data-v-6f989f3f'
|
|
226
231
|
_sfc_main.__hmrId = 'NInputNumber_nexa'
|
|
227
232
|
|
|
228
233
|
export default _sfc_main
|
|
229
234
|
|
|
230
|
-
const __style = `.n-inum[data-v-
|
|
231
|
-
injectStyle('data-v-
|
|
235
|
+
const __style = `.n-inum[data-v-6f989f3f]{display:flex;flex-direction:column;gap:var(--n-space-2);width:100%;font-family:var(--n-font-sans)}.n-inum-label{display:block;font-size:var(--n-text-sm);font-weight:var(--n-weight-medium);color:var(--n-color-text-secondary);margin-bottom:var(--n-space-2)}.n-inum-wrap{display:flex;align-items:stretch;min-height:44px;background:var(--n-color-surface);border:1px solid var(--n-color-border);border-radius:var(--n-radius-md);overflow:hidden;transition:all var(--n-transition-fast)}.n-inum-wrap:focus-within{border-color:var(--n-color-primary);box-shadow:0 0 0 3px var(--n-color-primary-light)}.n-inum-input{flex:1;background:transparent;border:none;outline:none;padding:0.75rem 0.75rem;color:var(--n-color-text);font-size:var(--n-text-base);font-family:inherit;text-align:center;line-height:1.2;box-sizing:border-box}.n-inum-btn{width:2.5rem;background:transparent;border:none;color:var(--n-color-text-muted);cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:var(--n-text-base);transition:all var(--n-transition-fast)}.n-inum-btn:hover:not(:disabled){background:var(--n-color-glass);color:var(--n-color-text)}.n-inum-btn:disabled{opacity:0.5;cursor:not-allowed}.is-disabled{opacity:0.6;cursor:not-allowed;background:var(--n-color-surface-alt)}`
|
|
236
|
+
injectStyle('data-v-6f989f3f', __style)
|
|
@@ -220,9 +220,9 @@ const onFocus = () => {
|
|
|
220
220
|
<div class="n-inum">
|
|
221
221
|
<label v-if="label" class="n-inum-label">{{ label }}</label>
|
|
222
222
|
<div class="n-inum-wrap" :class="{ 'is-disabled': effectiveDisabled.value }">
|
|
223
|
-
<button type="button" class="n-inum-btn n-inum-dec" :disabled="effectiveDisabled.value || readonly" aria-label="Decrement" @click="dec"
|
|
223
|
+
<button type="button" class="n-inum-btn n-inum-dec" :disabled="effectiveDisabled.value || readonly" aria-label="Decrement" @click="dec"><svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" focusable="false" aria-hidden="true"><line x1="5" y1="12" x2="19" y2="12"/></svg></button>
|
|
224
224
|
<input class="n-inum-input" type="text" :value="displayText.value" :placeholder="placeholder" :disabled="effectiveDisabled.value" :readonly="readonly" inputmode="decimal" autocomplete="off" @beforeinput="onBeforeInput" @keydown="onKeydown" @paste="onPaste" @input="onInput" @focus="onFocus" @blur="onBlur" />
|
|
225
|
-
<button type="button" class="n-inum-btn n-inum-inc" :disabled="effectiveDisabled.value || readonly" aria-label="Increment" @click="inc"
|
|
225
|
+
<button type="button" class="n-inum-btn n-inum-inc" :disabled="effectiveDisabled.value || readonly" aria-label="Increment" @click="inc"><svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" focusable="false" aria-hidden="true"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg></button>
|
|
226
226
|
</div>
|
|
227
227
|
</div>
|
|
228
228
|
</template>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { signal, effect, onMounted, onUnmounted, h, hText, defineComponent, registerComponent, reloadComponent, injectStyle, Teleport } from 'nexa-framework'
|
|
2
2
|
|
|
3
3
|
const _sfc_main = defineComponent({
|
|
4
|
-
__scopeId: 'data-v-
|
|
4
|
+
__scopeId: 'data-v-46af727f',
|
|
5
5
|
__hmrId: 'NModal_nexa',
|
|
6
6
|
props: {
|
|
7
7
|
show: { type: Boolean, default: false },
|
|
@@ -79,34 +79,40 @@ const _sfc_main = defineComponent({
|
|
|
79
79
|
// Injected render function
|
|
80
80
|
_sfc_main.render = function(ctx) {
|
|
81
81
|
let { isVisible, modalEl, previousFocus, bodyOverflow, setModalRef, sizeMap, close, handleEsc, handleOverlayClick, focusableSelector, handleKeydown, $slots, emit, show, title, size, closable, closeLeft, Fragment: _ntc_Fragment, Teleport: _ntc_Teleport } = ctx
|
|
82
|
-
return h(_ntc_Teleport, { to: "body", "data-v-
|
|
82
|
+
return h(_ntc_Teleport, { to: "body", "data-v-46af727f": "" }, [
|
|
83
83
|
"\r\n ",
|
|
84
|
-
(isVisible.value) ? h('div', { class: "n-modal-root", "data-v-
|
|
84
|
+
(isVisible.value) ? h('div', { class: "n-modal-root", "data-v-46af727f": "" }, [
|
|
85
85
|
"\r\n ",
|
|
86
|
-
h('div', { class: ["n-modal-overlay", { 'is-active': show }], onClick: handleOverlayClick, "data-v-
|
|
86
|
+
h('div', { class: ["n-modal-overlay", { 'is-active': show }], onClick: handleOverlayClick, "data-v-46af727f": "" }),
|
|
87
87
|
"\r\n ",
|
|
88
|
-
h('div', { class: ["n-modal-container", { 'is-active': show }], ref: setModalRef, style: { maxWidth: sizeMap[size] || size }, tabindex: "-1", onKeydown: handleKeydown, "data-v-
|
|
88
|
+
h('div', { class: ["n-modal-container", { 'is-active': show }], ref: setModalRef, style: { maxWidth: sizeMap[size] || size }, tabindex: "-1", onKeydown: handleKeydown, "data-v-46af727f": "" }, [
|
|
89
89
|
"\r\n ",
|
|
90
|
-
(title || $slots.header) ? h('div', { class: ["n-modal-header", { 'close-left': closeLeft }], "data-v-
|
|
90
|
+
(title || $slots.header) ? h('div', { class: ["n-modal-header", { 'close-left': closeLeft }], "data-v-46af727f": "" }, [
|
|
91
91
|
"\r\n ",
|
|
92
|
-
(closable && closeLeft) ? h('button', { class: "n-modal-close", onClick: close, "aria-label": "Close", "data-v-
|
|
93
|
-
"
|
|
92
|
+
(closable && closeLeft) ? h('button', { class: "n-modal-close", onClick: close, "aria-label": "Close", "data-v-46af727f": "" }, [
|
|
93
|
+
h('svg', { viewBox: "0 0 24 24", width: "20", height: "20", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", focusable: "false", "aria-hidden": "true", "data-v-46af727f": "" }, [
|
|
94
|
+
h('path', { d: "M18 6L6 18", "data-v-46af727f": "" }),
|
|
95
|
+
h('path', { d: "M6 6l12 12", "data-v-46af727f": "" })
|
|
96
|
+
])
|
|
94
97
|
]) : null,
|
|
95
98
|
ctx.$slots.header ? ctx.$slots.header() : ["\r\n ", h('h3', null, [
|
|
96
99
|
title
|
|
97
100
|
]), "\r\n "],
|
|
98
101
|
"\r\n ",
|
|
99
|
-
(closable && !closeLeft) ? h('button', { class: "n-modal-close", onClick: close, "aria-label": "Close", "data-v-
|
|
100
|
-
"
|
|
102
|
+
(closable && !closeLeft) ? h('button', { class: "n-modal-close", onClick: close, "aria-label": "Close", "data-v-46af727f": "" }, [
|
|
103
|
+
h('svg', { viewBox: "0 0 24 24", width: "20", height: "20", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", focusable: "false", "aria-hidden": "true", "data-v-46af727f": "" }, [
|
|
104
|
+
h('path', { d: "M18 6L6 18", "data-v-46af727f": "" }),
|
|
105
|
+
h('path', { d: "M6 6l12 12", "data-v-46af727f": "" })
|
|
106
|
+
])
|
|
101
107
|
]) : null
|
|
102
108
|
]) : null,
|
|
103
|
-
h('div', { class: "n-modal-content", "data-v-
|
|
109
|
+
h('div', { class: "n-modal-content", "data-v-46af727f": "" }, [
|
|
104
110
|
"\r\n ",
|
|
105
111
|
ctx.$slots.default ? ctx.$slots.default() : null,
|
|
106
112
|
"\r\n "
|
|
107
113
|
]),
|
|
108
114
|
"\r\n ",
|
|
109
|
-
($slots.footer) ? h('div', { class: "n-modal-footer", "data-v-
|
|
115
|
+
($slots.footer) ? h('div', { class: "n-modal-footer", "data-v-46af727f": "" }, [
|
|
110
116
|
"\r\n ",
|
|
111
117
|
ctx.$slots.footer ? ctx.$slots.footer() : null,
|
|
112
118
|
"\r\n "
|
|
@@ -116,12 +122,12 @@ _sfc_main.render = function(ctx) {
|
|
|
116
122
|
]) : null
|
|
117
123
|
])
|
|
118
124
|
}
|
|
119
|
-
_sfc_main.__scopeId = 'data-v-
|
|
125
|
+
_sfc_main.__scopeId = 'data-v-46af727f'
|
|
120
126
|
_sfc_main.__hmrId = 'NModal_nexa'
|
|
121
127
|
|
|
122
128
|
export default _sfc_main
|
|
123
129
|
|
|
124
|
-
const __style = `.n-modal-root[data-v-
|
|
130
|
+
const __style = `.n-modal-root[data-v-46af727f]{
|
|
125
131
|
position: fixed;
|
|
126
132
|
top: 0;
|
|
127
133
|
left: 0;
|
|
@@ -133,7 +139,7 @@ const __style = `.n-modal-root[data-v-51b57181]{
|
|
|
133
139
|
z-index: var(--n-z-modal);
|
|
134
140
|
}
|
|
135
141
|
|
|
136
|
-
.n-modal-overlay[data-v-
|
|
142
|
+
.n-modal-overlay[data-v-46af727f]{
|
|
137
143
|
position: absolute;
|
|
138
144
|
top: 0;
|
|
139
145
|
left: 0;
|
|
@@ -145,11 +151,11 @@ const __style = `.n-modal-root[data-v-51b57181]{
|
|
|
145
151
|
transition: opacity 0.25s ease;
|
|
146
152
|
}
|
|
147
153
|
|
|
148
|
-
.n-modal-overlay.is-active[data-v-
|
|
154
|
+
.n-modal-overlay.is-active[data-v-46af727f]{
|
|
149
155
|
opacity: 1;
|
|
150
156
|
}
|
|
151
157
|
|
|
152
|
-
.n-modal-container[data-v-
|
|
158
|
+
.n-modal-container[data-v-46af727f]{
|
|
153
159
|
position: relative;
|
|
154
160
|
width: 90%;
|
|
155
161
|
background: var(--n-color-surface);
|
|
@@ -158,7 +164,7 @@ const __style = `.n-modal-root[data-v-51b57181]{
|
|
|
158
164
|
box-shadow: var(--n-shadow-xl);
|
|
159
165
|
transform: scale(0.9) translateY(20px);
|
|
160
166
|
opacity: 0;
|
|
161
|
-
transition: all
|
|
167
|
+
transition: all var(--n-transition-spring);
|
|
162
168
|
overflow: hidden;
|
|
163
169
|
outline: none;
|
|
164
170
|
max-height: 85vh;
|
|
@@ -166,12 +172,12 @@ const __style = `.n-modal-root[data-v-51b57181]{
|
|
|
166
172
|
flex-direction: column;
|
|
167
173
|
}
|
|
168
174
|
|
|
169
|
-
.n-modal-container.is-active[data-v-
|
|
175
|
+
.n-modal-container.is-active[data-v-46af727f]{
|
|
170
176
|
transform: scale(1) translateY(0);
|
|
171
177
|
opacity: 1;
|
|
172
178
|
}
|
|
173
179
|
|
|
174
|
-
.n-modal-header[data-v-
|
|
180
|
+
.n-modal-header[data-v-46af727f]{
|
|
175
181
|
padding: var(--n-space-6) var(--n-space-8);
|
|
176
182
|
border-bottom: 1px solid var(--n-color-border);
|
|
177
183
|
display: flex;
|
|
@@ -180,14 +186,14 @@ const __style = `.n-modal-root[data-v-51b57181]{
|
|
|
180
186
|
flex-shrink: 0;
|
|
181
187
|
}
|
|
182
188
|
|
|
183
|
-
.n-modal-header h3[data-v-
|
|
189
|
+
.n-modal-header h3[data-v-46af727f]{
|
|
184
190
|
margin: 0;
|
|
185
191
|
font-size: var(--n-text-xl);
|
|
186
192
|
font-weight: var(--n-weight-bold);
|
|
187
193
|
color: var(--n-color-text);
|
|
188
194
|
}
|
|
189
195
|
|
|
190
|
-
.n-modal-close[data-v-
|
|
196
|
+
.n-modal-close[data-v-46af727f]{
|
|
191
197
|
background: transparent;
|
|
192
198
|
border: none;
|
|
193
199
|
color: var(--n-color-text-secondary);
|
|
@@ -204,12 +210,12 @@ const __style = `.n-modal-root[data-v-51b57181]{
|
|
|
204
210
|
border-radius: var(--n-radius-sm);
|
|
205
211
|
}
|
|
206
212
|
|
|
207
|
-
.n-modal-close[data-v-
|
|
213
|
+
.n-modal-close[data-v-46af727f]:hover{
|
|
208
214
|
color: var(--n-color-text);
|
|
209
215
|
background: var(--n-color-glass);
|
|
210
216
|
}
|
|
211
217
|
|
|
212
|
-
.n-modal-content[data-v-
|
|
218
|
+
.n-modal-content[data-v-46af727f]{
|
|
213
219
|
padding: var(--n-space-8);
|
|
214
220
|
color: var(--n-color-text-secondary);
|
|
215
221
|
overflow-y: auto;
|
|
@@ -217,13 +223,13 @@ const __style = `.n-modal-root[data-v-51b57181]{
|
|
|
217
223
|
flex: 1;
|
|
218
224
|
}
|
|
219
225
|
|
|
220
|
-
.n-modal-footer[data-v-
|
|
226
|
+
.n-modal-footer[data-v-46af727f]{
|
|
221
227
|
padding: var(--n-space-5) var(--n-space-8);
|
|
222
|
-
background:
|
|
228
|
+
background: var(--n-color-glass);
|
|
223
229
|
border-top: 1px solid var(--n-color-border);
|
|
224
230
|
display: flex;
|
|
225
231
|
justify-content: flex-end;
|
|
226
232
|
gap: var(--n-space-4);
|
|
227
233
|
flex-shrink: 0;
|
|
228
234
|
}`
|
|
229
|
-
injectStyle('data-v-
|
|
235
|
+
injectStyle('data-v-46af727f', __style)
|
|
@@ -100,11 +100,11 @@ onUnmounted(() => {
|
|
|
100
100
|
@keydown="handleKeydown"
|
|
101
101
|
>
|
|
102
102
|
<div v-if="title || $slots.header" class="n-modal-header" :class="{ 'close-left': closeLeft }">
|
|
103
|
-
<button v-if="closable && closeLeft" class="n-modal-close" @click="close" aria-label="Close"
|
|
103
|
+
<button v-if="closable && closeLeft" class="n-modal-close" @click="close" aria-label="Close"><svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" focusable="false" aria-hidden="true"><path d="M18 6L6 18"/><path d="M6 6l12 12"/></svg></button>
|
|
104
104
|
<slot name="header">
|
|
105
105
|
<h3>{{ title }}</h3>
|
|
106
106
|
</slot>
|
|
107
|
-
<button v-if="closable && !closeLeft" class="n-modal-close" @click="close" aria-label="Close"
|
|
107
|
+
<button v-if="closable && !closeLeft" class="n-modal-close" @click="close" aria-label="Close"><svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" focusable="false" aria-hidden="true"><path d="M18 6L6 18"/><path d="M6 6l12 12"/></svg></button>
|
|
108
108
|
</div>
|
|
109
109
|
<div class="n-modal-content">
|
|
110
110
|
<slot />
|
|
@@ -155,7 +155,7 @@ onUnmounted(() => {
|
|
|
155
155
|
box-shadow: var(--n-shadow-xl);
|
|
156
156
|
transform: scale(0.9) translateY(20px);
|
|
157
157
|
opacity: 0;
|
|
158
|
-
transition: all
|
|
158
|
+
transition: all var(--n-transition-spring);
|
|
159
159
|
overflow: hidden;
|
|
160
160
|
outline: none;
|
|
161
161
|
max-height: 85vh;
|
|
@@ -216,7 +216,7 @@ onUnmounted(() => {
|
|
|
216
216
|
|
|
217
217
|
.n-modal-footer {
|
|
218
218
|
padding: var(--n-space-5) var(--n-space-8);
|
|
219
|
-
background:
|
|
219
|
+
background: var(--n-color-glass);
|
|
220
220
|
border-top: 1px solid var(--n-color-border);
|
|
221
221
|
display: flex;
|
|
222
222
|
justify-content: flex-end;
|