@ktjs/mui 0.17.7 → 0.17.9
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/index.d.ts +2 -2
- package/dist/index.iife.js +4 -6
- package/dist/index.mjs +4 -6
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -9,9 +9,9 @@ interface AlertProps {
|
|
|
9
9
|
severity?: 'error' | 'warning' | 'info' | 'success';
|
|
10
10
|
variant?: 'standard' | 'filled' | 'outlined';
|
|
11
11
|
icon?: HTMLElement | KTHTMLElement | false;
|
|
12
|
-
|
|
12
|
+
'mui:close'?: () => void;
|
|
13
13
|
}
|
|
14
|
-
/**
|
|
14
|
+
/**s
|
|
15
15
|
* Alert component - mimics MUI Alert appearance and behavior
|
|
16
16
|
*/
|
|
17
17
|
declare function Alert(props: AlertProps): KTHTMLElement;
|
package/dist/index.iife.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
var __ktjs_mui__ = (function (exports, jsxRuntime, kt_js) {
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
/**
|
|
4
|
+
/**s
|
|
5
5
|
* Alert component - mimics MUI Alert appearance and behavior
|
|
6
6
|
*/
|
|
7
7
|
function Alert(props) {
|
|
8
|
-
const { children, severity = 'info', variant = 'standard', icon, onClose, sx } = props;
|
|
9
|
-
const classes =
|
|
10
|
-
.filter(Boolean)
|
|
11
|
-
.join(' ');
|
|
8
|
+
const { children, severity = 'info', variant = 'standard', icon, 'mui:close': onClose, sx } = props;
|
|
9
|
+
const classes = `mui-alert mui-alert-${severity} mui-alert-${variant} ${props.class ? props.class : ''}`;
|
|
12
10
|
// Convert sx object to style string
|
|
13
11
|
let styleString = props.style || '';
|
|
14
12
|
if (sx) {
|
|
@@ -374,7 +372,7 @@ var __ktjs_mui__ = (function (exports, jsxRuntime, kt_js) {
|
|
|
374
372
|
// Create input or textarea element
|
|
375
373
|
// Only show placeholder when label is floating (focused or has value)
|
|
376
374
|
const getPlaceholder = () => (label && !isFocused && !value ? '' : placeholder);
|
|
377
|
-
const inputElement = multiline ? (jsxRuntime.jsx("textarea", { ref: inputRef, class: "mui-textfield-input", placeholder: getPlaceholder(), value: value, disabled: disabled,
|
|
375
|
+
const inputElement = multiline ? (jsxRuntime.jsx("textarea", { ref: inputRef, class: "mui-textfield-input", placeholder: getPlaceholder(), value: value, disabled: disabled, readOnly: readonly, required: required, rows: rows, "on:input": handleInput, "on:change": handleChange, "on:focus": handleFocus, "on:blur": handleBlur })) : (jsxRuntime.jsx("input", { ref: inputRef, type: type, class: "mui-textfield-input", placeholder: getPlaceholder(), value: value, disabled: disabled, readOnly: readonly, required: required, "on:input": handleInput, "on:change": handleChange, "on:focus": handleFocus, "on:blur": handleBlur }));
|
|
378
376
|
const container = (jsxRuntime.jsxs("div", { class: 'mui-textfield-root ' + (props.class ? props.class : ''), style: props.style ? props.style : '', children: [jsxRuntime.jsxs("div", { class: "mui-textfield-wrapper", children: [jsxRuntime.jsxs("label", { "k-if": label, class: "mui-textfield-label", children: [label, required && jsxRuntime.jsx("span", { class: "mui-textfield-required", children: "*" })] }), jsxRuntime.jsx("div", { class: "mui-textfield-input-wrapper", children: inputElement }), jsxRuntime.jsx("fieldset", { class: "mui-textfield-fieldset", children: jsxRuntime.jsx("legend", { "k-if": label, class: "mui-textfield-legend", children: jsxRuntime.jsxs("span", { children: [label, required && '*'] }) }) })] }), helperText && jsxRuntime.jsx("p", { class: "mui-textfield-helper-text", children: helperText })] }));
|
|
379
377
|
// Initialize classes
|
|
380
378
|
setTimeout(() => updateClasses(), 0);
|
package/dist/index.mjs
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'kt.js/jsx-runtime';
|
|
2
2
|
import { ref as ref$1, createRedrawable } from 'kt.js';
|
|
3
3
|
|
|
4
|
-
/**
|
|
4
|
+
/**s
|
|
5
5
|
* Alert component - mimics MUI Alert appearance and behavior
|
|
6
6
|
*/
|
|
7
7
|
function Alert(props) {
|
|
8
|
-
const { children, severity = 'info', variant = 'standard', icon, onClose, sx } = props;
|
|
9
|
-
const classes =
|
|
10
|
-
.filter(Boolean)
|
|
11
|
-
.join(' ');
|
|
8
|
+
const { children, severity = 'info', variant = 'standard', icon, 'mui:close': onClose, sx } = props;
|
|
9
|
+
const classes = `mui-alert mui-alert-${severity} mui-alert-${variant} ${props.class ? props.class : ''}`;
|
|
12
10
|
// Convert sx object to style string
|
|
13
11
|
let styleString = props.style || '';
|
|
14
12
|
if (sx) {
|
|
@@ -374,7 +372,7 @@ function TextField(props) {
|
|
|
374
372
|
// Create input or textarea element
|
|
375
373
|
// Only show placeholder when label is floating (focused or has value)
|
|
376
374
|
const getPlaceholder = () => (label && !isFocused && !value ? '' : placeholder);
|
|
377
|
-
const inputElement = multiline ? (jsx("textarea", { ref: inputRef, class: "mui-textfield-input", placeholder: getPlaceholder(), value: value, disabled: disabled,
|
|
375
|
+
const inputElement = multiline ? (jsx("textarea", { ref: inputRef, class: "mui-textfield-input", placeholder: getPlaceholder(), value: value, disabled: disabled, readOnly: readonly, required: required, rows: rows, "on:input": handleInput, "on:change": handleChange, "on:focus": handleFocus, "on:blur": handleBlur })) : (jsx("input", { ref: inputRef, type: type, class: "mui-textfield-input", placeholder: getPlaceholder(), value: value, disabled: disabled, readOnly: readonly, required: required, "on:input": handleInput, "on:change": handleChange, "on:focus": handleFocus, "on:blur": handleBlur }));
|
|
378
376
|
const container = (jsxs("div", { class: 'mui-textfield-root ' + (props.class ? props.class : ''), style: props.style ? props.style : '', children: [jsxs("div", { class: "mui-textfield-wrapper", children: [jsxs("label", { "k-if": label, class: "mui-textfield-label", children: [label, required && jsx("span", { class: "mui-textfield-required", children: "*" })] }), jsx("div", { class: "mui-textfield-input-wrapper", children: inputElement }), jsx("fieldset", { class: "mui-textfield-fieldset", children: jsx("legend", { "k-if": label, class: "mui-textfield-legend", children: jsxs("span", { children: [label, required && '*'] }) }) })] }), helperText && jsx("p", { class: "mui-textfield-helper-text", children: helperText })] }));
|
|
379
377
|
// Initialize classes
|
|
380
378
|
setTimeout(() => updateClasses(), 0);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ktjs/mui",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.9",
|
|
4
4
|
"description": "Material-UI inspired components for kt.js - pre-styled UI components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"directory": "packages/mui"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@ktjs/core": "0.
|
|
38
|
+
"@ktjs/core": "0.18.0"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
41
|
"build": "rollup -c rollup.config.mjs",
|