mithril-materialized 3.14.2 → 3.14.4
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.esm.js +100 -91
- package/dist/index.js +100 -91
- package/dist/index.umd.js +100 -91
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -618,90 +618,6 @@ const Icon = () => ({
|
|
|
618
618
|
},
|
|
619
619
|
});
|
|
620
620
|
|
|
621
|
-
const iconPaths = {
|
|
622
|
-
caret: [
|
|
623
|
-
'M7 10l5 5 5-5z', // arrow
|
|
624
|
-
'M0 0h24v24H0z', // background
|
|
625
|
-
],
|
|
626
|
-
close: [
|
|
627
|
-
'M18.3 5.71a1 1 0 0 0-1.41 0L12 10.59 7.11 5.7A1 1 0 0 0 5.7 7.11L10.59 12l-4.89 4.89a1 1 0 1 0 1.41 1.41L12 13.41l4.89 4.89a1 1 0 0 0 1.41-1.41L13.41 12l4.89-4.89a1 1 0 0 0 0-1.4z',
|
|
628
|
-
'M0 0h24v24H0z',
|
|
629
|
-
],
|
|
630
|
-
chevron: [
|
|
631
|
-
'M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z', // chevron down
|
|
632
|
-
'M0 0h24v24H0z', // background
|
|
633
|
-
],
|
|
634
|
-
chevron_left: [
|
|
635
|
-
'M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z', // chevron left
|
|
636
|
-
'M0 0h24v24H0z', // background
|
|
637
|
-
],
|
|
638
|
-
chevron_right: [
|
|
639
|
-
'M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z', // chevron right
|
|
640
|
-
'M0 0h24v24H0z', // background
|
|
641
|
-
],
|
|
642
|
-
menu: [
|
|
643
|
-
'M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z', // hamburger menu
|
|
644
|
-
'M0 0h24v24H0z', // background
|
|
645
|
-
],
|
|
646
|
-
expand: [
|
|
647
|
-
'M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z', // plus
|
|
648
|
-
'M0 0h24v24H0z', // background
|
|
649
|
-
],
|
|
650
|
-
collapse: [
|
|
651
|
-
'M19 13H5v-2h14v2z', // minus
|
|
652
|
-
'M0 0h24v24H0z', // background
|
|
653
|
-
],
|
|
654
|
-
check: [
|
|
655
|
-
'M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z', // checkmark
|
|
656
|
-
'M0 0h24v24H0z', // background
|
|
657
|
-
],
|
|
658
|
-
radio_checked: [
|
|
659
|
-
'M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z', // radio button checked
|
|
660
|
-
'M0 0h24v24H0z', // background
|
|
661
|
-
],
|
|
662
|
-
radio_unchecked: [
|
|
663
|
-
'M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z', // radio button unchecked
|
|
664
|
-
'M0 0h24v24H0z', // background
|
|
665
|
-
],
|
|
666
|
-
light_mode: [
|
|
667
|
-
'M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5M2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1m18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1M11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1m0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1M5.99 4.58a.996.996 0 0 0-1.41 0 .996.996 0 0 0 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41zm12.4 12.4a.996.996 0 0 0-1.41 0 .996.996 0 0 0 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0a.996.996 0 0 0 0-1.41zm1.06-11a.996.996 0 0 0 0-1.41.996.996 0 0 0-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0zM7.05 18.4a.996.996 0 0 0 0-1.41.996.996 0 0 0-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0z',
|
|
668
|
-
'M0 0h24v24H0z', // background
|
|
669
|
-
],
|
|
670
|
-
dark_mode: [
|
|
671
|
-
'M12 3a9 9 0 1 0 9 9c0-.46-.04-.92-.1-1.36a5.39 5.39 0 0 1-4.4 2.26 5.4 5.4 0 0 1-3.14-9.8c-.44-.06-.9-.1-1.36-.1z',
|
|
672
|
-
'M0 0h24v24H0z', // background
|
|
673
|
-
],
|
|
674
|
-
delete: [
|
|
675
|
-
// trashbin
|
|
676
|
-
'M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z',
|
|
677
|
-
'M0 0h24v24H0z', // background
|
|
678
|
-
],
|
|
679
|
-
};
|
|
680
|
-
const MaterialIcon = () => {
|
|
681
|
-
return {
|
|
682
|
-
view: ({ attrs }) => {
|
|
683
|
-
var _a;
|
|
684
|
-
const { name, direction = 'down', style } = attrs, props = __rest(attrs, ["name", "direction", "style"]);
|
|
685
|
-
const rotationMap = {
|
|
686
|
-
down: 0,
|
|
687
|
-
up: 180,
|
|
688
|
-
left: 90,
|
|
689
|
-
right: -90,
|
|
690
|
-
};
|
|
691
|
-
const rotation = (_a = rotationMap[direction]) !== null && _a !== void 0 ? _a : 0;
|
|
692
|
-
const transform = rotation ? `rotate(${rotation}deg)` : undefined;
|
|
693
|
-
const icon = iconPaths[name];
|
|
694
|
-
if (!icon || !Array.isArray(icon)) {
|
|
695
|
-
return m(Icon, Object.assign(Object.assign({}, props), { iconName: name }));
|
|
696
|
-
}
|
|
697
|
-
return m('svg', Object.assign(Object.assign({}, props), { style: Object.assign({ transform }, style), height: '24px', width: '24px', viewBox: '0 0 24 24', xmlns: 'http://www.w3.org/2000/svg' }), icon === null || icon === void 0 ? void 0 : icon.map((d) => m('path', {
|
|
698
|
-
d,
|
|
699
|
-
fill: d.includes('M0 0h24v24H0z') ? 'none' : 'currentColor',
|
|
700
|
-
})));
|
|
701
|
-
},
|
|
702
|
-
};
|
|
703
|
-
};
|
|
704
|
-
|
|
705
621
|
/*!
|
|
706
622
|
* Waves Effect for Mithril Materialized
|
|
707
623
|
* Based on Waves v0.6.4 by Alfiana E. Sibuea
|
|
@@ -825,7 +741,7 @@ const ButtonFactory = (element, defaultClassNames, type = '') => {
|
|
|
825
741
|
ontouchend: WavesEffect.onTouchEnd,
|
|
826
742
|
}
|
|
827
743
|
: {};
|
|
828
|
-
return m(element, Object.assign(Object.assign(Object.assign({}, params), wavesHandlers), { className: cn, 'data-position': tooltip ? position : undefined, 'data-tooltip': tooltip || undefined, type: buttonType }), iconName ? m(Icon, { iconName, className: iconClass
|
|
744
|
+
return m(element, Object.assign(Object.assign(Object.assign({}, params), wavesHandlers), { className: cn, 'data-position': tooltip ? position : undefined, 'data-tooltip': tooltip || undefined, type: buttonType }), iconName ? m(Icon, { iconName, className: iconClass !== undefined ? iconClass : 'left' }) : undefined, label ? label : undefined, children);
|
|
829
745
|
},
|
|
830
746
|
};
|
|
831
747
|
};
|
|
@@ -837,7 +753,7 @@ const FlatButton = ButtonFactory('a', 'waves-effect waves-teal btn-flat', 'butto
|
|
|
837
753
|
const IconButton = ButtonFactory('button', 'btn-flat btn-icon waves-effect waves-teal', 'button');
|
|
838
754
|
const RoundIconButton = ButtonFactory('button', 'btn-floating btn-large waves-effect waves-light', 'button');
|
|
839
755
|
const SubmitButton = ButtonFactory('button', 'btn waves-effect waves-light', 'submit');
|
|
840
|
-
const
|
|
756
|
+
const SmallRaisedIconButton = ButtonFactory('button', 'btn-small btn-icon waves-effect waves-light', 'button');
|
|
841
757
|
const ConfirmButton = () => {
|
|
842
758
|
let isConfirming = false;
|
|
843
759
|
let isBlocked = false;
|
|
@@ -857,7 +773,7 @@ const ConfirmButton = () => {
|
|
|
857
773
|
window.clearTimeout(blockTimeoutId);
|
|
858
774
|
},
|
|
859
775
|
view: ({ attrs }) => {
|
|
860
|
-
const { iconName = 'delete', confirmIconName = 'check', confirmColor = 'red', timeout = 3000, clickDelay = 500, onFirstClick, onclick } = attrs, props = __rest(attrs, ["iconName", "confirmIconName", "confirmColor", "timeout", "clickDelay", "onFirstClick", "onclick"]);
|
|
776
|
+
const { iconName = 'delete', confirmIconName = 'check', confirmColor = 'red', timeout = 3000, clickDelay = 500, onFirstClick, onclick, iconClass, label } = attrs, props = __rest(attrs, ["iconName", "confirmIconName", "confirmColor", "timeout", "clickDelay", "onFirstClick", "onclick", "iconClass", "label"]);
|
|
861
777
|
const handleClick = (e) => {
|
|
862
778
|
e.preventDefault();
|
|
863
779
|
if (isBlocked)
|
|
@@ -876,12 +792,21 @@ const ConfirmButton = () => {
|
|
|
876
792
|
blockTimeoutId = window.setTimeout(unblock, clickDelay);
|
|
877
793
|
}
|
|
878
794
|
};
|
|
795
|
+
const currentIconName = isConfirming ? confirmIconName : iconName;
|
|
879
796
|
const cn = isConfirming ? confirmColor : 'red-text';
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
797
|
+
// Choose button component based on label and confirming state
|
|
798
|
+
let ButtonComponent;
|
|
799
|
+
if (label) {
|
|
800
|
+
ButtonComponent = FlatButton;
|
|
801
|
+
}
|
|
802
|
+
else {
|
|
803
|
+
// Icon-only: use small raised button for square shape when confirming
|
|
804
|
+
ButtonComponent = isConfirming ? SmallRaisedIconButton : IconButton;
|
|
883
805
|
}
|
|
884
|
-
|
|
806
|
+
// Add square styling for icon-only confirming state
|
|
807
|
+
const buttonStyle = !label && isConfirming
|
|
808
|
+
? Object.assign(Object.assign({}, props.style), { width: '36px', height: '36px', padding: '0', minWidth: '28px', display: 'inline-flex', alignItems: 'center', justifyContent: 'center', borderRadius: '2px' }) : props.style;
|
|
809
|
+
return m(ButtonComponent, Object.assign(Object.assign({}, props), { style: buttonStyle, className: `${props.className || ''} ${cn}`, iconName: currentIconName, iconClass: label ? (iconClass || 'left') : '', label, onclick: handleClick }));
|
|
885
810
|
},
|
|
886
811
|
};
|
|
887
812
|
};
|
|
@@ -1276,6 +1201,90 @@ const Carousel = () => {
|
|
|
1276
1201
|
};
|
|
1277
1202
|
};
|
|
1278
1203
|
|
|
1204
|
+
const iconPaths = {
|
|
1205
|
+
caret: [
|
|
1206
|
+
'M7 10l5 5 5-5z', // arrow
|
|
1207
|
+
'M0 0h24v24H0z', // background
|
|
1208
|
+
],
|
|
1209
|
+
close: [
|
|
1210
|
+
'M18.3 5.71a1 1 0 0 0-1.41 0L12 10.59 7.11 5.7A1 1 0 0 0 5.7 7.11L10.59 12l-4.89 4.89a1 1 0 1 0 1.41 1.41L12 13.41l4.89 4.89a1 1 0 0 0 1.41-1.41L13.41 12l4.89-4.89a1 1 0 0 0 0-1.4z',
|
|
1211
|
+
'M0 0h24v24H0z',
|
|
1212
|
+
],
|
|
1213
|
+
chevron: [
|
|
1214
|
+
'M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z', // chevron down
|
|
1215
|
+
'M0 0h24v24H0z', // background
|
|
1216
|
+
],
|
|
1217
|
+
chevron_left: [
|
|
1218
|
+
'M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z', // chevron left
|
|
1219
|
+
'M0 0h24v24H0z', // background
|
|
1220
|
+
],
|
|
1221
|
+
chevron_right: [
|
|
1222
|
+
'M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z', // chevron right
|
|
1223
|
+
'M0 0h24v24H0z', // background
|
|
1224
|
+
],
|
|
1225
|
+
menu: [
|
|
1226
|
+
'M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z', // hamburger menu
|
|
1227
|
+
'M0 0h24v24H0z', // background
|
|
1228
|
+
],
|
|
1229
|
+
expand: [
|
|
1230
|
+
'M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z', // plus
|
|
1231
|
+
'M0 0h24v24H0z', // background
|
|
1232
|
+
],
|
|
1233
|
+
collapse: [
|
|
1234
|
+
'M19 13H5v-2h14v2z', // minus
|
|
1235
|
+
'M0 0h24v24H0z', // background
|
|
1236
|
+
],
|
|
1237
|
+
check: [
|
|
1238
|
+
'M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z', // checkmark
|
|
1239
|
+
'M0 0h24v24H0z', // background
|
|
1240
|
+
],
|
|
1241
|
+
radio_checked: [
|
|
1242
|
+
'M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z', // radio button checked
|
|
1243
|
+
'M0 0h24v24H0z', // background
|
|
1244
|
+
],
|
|
1245
|
+
radio_unchecked: [
|
|
1246
|
+
'M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z', // radio button unchecked
|
|
1247
|
+
'M0 0h24v24H0z', // background
|
|
1248
|
+
],
|
|
1249
|
+
light_mode: [
|
|
1250
|
+
'M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5M2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1m18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1M11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1m0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1M5.99 4.58a.996.996 0 0 0-1.41 0 .996.996 0 0 0 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41zm12.4 12.4a.996.996 0 0 0-1.41 0 .996.996 0 0 0 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0a.996.996 0 0 0 0-1.41zm1.06-11a.996.996 0 0 0 0-1.41.996.996 0 0 0-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0zM7.05 18.4a.996.996 0 0 0 0-1.41.996.996 0 0 0-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0z',
|
|
1251
|
+
'M0 0h24v24H0z', // background
|
|
1252
|
+
],
|
|
1253
|
+
dark_mode: [
|
|
1254
|
+
'M12 3a9 9 0 1 0 9 9c0-.46-.04-.92-.1-1.36a5.39 5.39 0 0 1-4.4 2.26 5.4 5.4 0 0 1-3.14-9.8c-.44-.06-.9-.1-1.36-.1z',
|
|
1255
|
+
'M0 0h24v24H0z', // background
|
|
1256
|
+
],
|
|
1257
|
+
delete: [
|
|
1258
|
+
// trashbin
|
|
1259
|
+
'M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z',
|
|
1260
|
+
'M0 0h24v24H0z', // background
|
|
1261
|
+
],
|
|
1262
|
+
};
|
|
1263
|
+
const MaterialIcon = () => {
|
|
1264
|
+
return {
|
|
1265
|
+
view: ({ attrs }) => {
|
|
1266
|
+
var _a;
|
|
1267
|
+
const { name, direction = 'down', style } = attrs, props = __rest(attrs, ["name", "direction", "style"]);
|
|
1268
|
+
const rotationMap = {
|
|
1269
|
+
down: 0,
|
|
1270
|
+
up: 180,
|
|
1271
|
+
left: 90,
|
|
1272
|
+
right: -90,
|
|
1273
|
+
};
|
|
1274
|
+
const rotation = (_a = rotationMap[direction]) !== null && _a !== void 0 ? _a : 0;
|
|
1275
|
+
const transform = rotation ? `rotate(${rotation}deg)` : undefined;
|
|
1276
|
+
const icon = iconPaths[name];
|
|
1277
|
+
if (!icon || !Array.isArray(icon)) {
|
|
1278
|
+
return m(Icon, Object.assign(Object.assign({}, props), { iconName: name }));
|
|
1279
|
+
}
|
|
1280
|
+
return m('svg', Object.assign(Object.assign({}, props), { style: Object.assign({ display: 'inline-block', verticalAlign: 'middle', transform }, style), height: '24px', width: '24px', viewBox: '0 0 24 24', xmlns: 'http://www.w3.org/2000/svg' }), icon === null || icon === void 0 ? void 0 : icon.map((d) => m('path', {
|
|
1281
|
+
d,
|
|
1282
|
+
fill: d.includes('M0 0h24v24H0z') ? 'none' : 'currentColor',
|
|
1283
|
+
})));
|
|
1284
|
+
},
|
|
1285
|
+
};
|
|
1286
|
+
};
|
|
1287
|
+
|
|
1279
1288
|
const Chips = () => {
|
|
1280
1289
|
const state = {
|
|
1281
1290
|
chipsData: [],
|
package/dist/index.js
CHANGED
|
@@ -620,90 +620,6 @@ const Icon = () => ({
|
|
|
620
620
|
},
|
|
621
621
|
});
|
|
622
622
|
|
|
623
|
-
const iconPaths = {
|
|
624
|
-
caret: [
|
|
625
|
-
'M7 10l5 5 5-5z', // arrow
|
|
626
|
-
'M0 0h24v24H0z', // background
|
|
627
|
-
],
|
|
628
|
-
close: [
|
|
629
|
-
'M18.3 5.71a1 1 0 0 0-1.41 0L12 10.59 7.11 5.7A1 1 0 0 0 5.7 7.11L10.59 12l-4.89 4.89a1 1 0 1 0 1.41 1.41L12 13.41l4.89 4.89a1 1 0 0 0 1.41-1.41L13.41 12l4.89-4.89a1 1 0 0 0 0-1.4z',
|
|
630
|
-
'M0 0h24v24H0z',
|
|
631
|
-
],
|
|
632
|
-
chevron: [
|
|
633
|
-
'M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z', // chevron down
|
|
634
|
-
'M0 0h24v24H0z', // background
|
|
635
|
-
],
|
|
636
|
-
chevron_left: [
|
|
637
|
-
'M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z', // chevron left
|
|
638
|
-
'M0 0h24v24H0z', // background
|
|
639
|
-
],
|
|
640
|
-
chevron_right: [
|
|
641
|
-
'M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z', // chevron right
|
|
642
|
-
'M0 0h24v24H0z', // background
|
|
643
|
-
],
|
|
644
|
-
menu: [
|
|
645
|
-
'M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z', // hamburger menu
|
|
646
|
-
'M0 0h24v24H0z', // background
|
|
647
|
-
],
|
|
648
|
-
expand: [
|
|
649
|
-
'M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z', // plus
|
|
650
|
-
'M0 0h24v24H0z', // background
|
|
651
|
-
],
|
|
652
|
-
collapse: [
|
|
653
|
-
'M19 13H5v-2h14v2z', // minus
|
|
654
|
-
'M0 0h24v24H0z', // background
|
|
655
|
-
],
|
|
656
|
-
check: [
|
|
657
|
-
'M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z', // checkmark
|
|
658
|
-
'M0 0h24v24H0z', // background
|
|
659
|
-
],
|
|
660
|
-
radio_checked: [
|
|
661
|
-
'M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z', // radio button checked
|
|
662
|
-
'M0 0h24v24H0z', // background
|
|
663
|
-
],
|
|
664
|
-
radio_unchecked: [
|
|
665
|
-
'M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z', // radio button unchecked
|
|
666
|
-
'M0 0h24v24H0z', // background
|
|
667
|
-
],
|
|
668
|
-
light_mode: [
|
|
669
|
-
'M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5M2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1m18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1M11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1m0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1M5.99 4.58a.996.996 0 0 0-1.41 0 .996.996 0 0 0 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41zm12.4 12.4a.996.996 0 0 0-1.41 0 .996.996 0 0 0 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0a.996.996 0 0 0 0-1.41zm1.06-11a.996.996 0 0 0 0-1.41.996.996 0 0 0-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0zM7.05 18.4a.996.996 0 0 0 0-1.41.996.996 0 0 0-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0z',
|
|
670
|
-
'M0 0h24v24H0z', // background
|
|
671
|
-
],
|
|
672
|
-
dark_mode: [
|
|
673
|
-
'M12 3a9 9 0 1 0 9 9c0-.46-.04-.92-.1-1.36a5.39 5.39 0 0 1-4.4 2.26 5.4 5.4 0 0 1-3.14-9.8c-.44-.06-.9-.1-1.36-.1z',
|
|
674
|
-
'M0 0h24v24H0z', // background
|
|
675
|
-
],
|
|
676
|
-
delete: [
|
|
677
|
-
// trashbin
|
|
678
|
-
'M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z',
|
|
679
|
-
'M0 0h24v24H0z', // background
|
|
680
|
-
],
|
|
681
|
-
};
|
|
682
|
-
const MaterialIcon = () => {
|
|
683
|
-
return {
|
|
684
|
-
view: ({ attrs }) => {
|
|
685
|
-
var _a;
|
|
686
|
-
const { name, direction = 'down', style } = attrs, props = __rest(attrs, ["name", "direction", "style"]);
|
|
687
|
-
const rotationMap = {
|
|
688
|
-
down: 0,
|
|
689
|
-
up: 180,
|
|
690
|
-
left: 90,
|
|
691
|
-
right: -90,
|
|
692
|
-
};
|
|
693
|
-
const rotation = (_a = rotationMap[direction]) !== null && _a !== void 0 ? _a : 0;
|
|
694
|
-
const transform = rotation ? `rotate(${rotation}deg)` : undefined;
|
|
695
|
-
const icon = iconPaths[name];
|
|
696
|
-
if (!icon || !Array.isArray(icon)) {
|
|
697
|
-
return m(Icon, Object.assign(Object.assign({}, props), { iconName: name }));
|
|
698
|
-
}
|
|
699
|
-
return m('svg', Object.assign(Object.assign({}, props), { style: Object.assign({ transform }, style), height: '24px', width: '24px', viewBox: '0 0 24 24', xmlns: 'http://www.w3.org/2000/svg' }), icon === null || icon === void 0 ? void 0 : icon.map((d) => m('path', {
|
|
700
|
-
d,
|
|
701
|
-
fill: d.includes('M0 0h24v24H0z') ? 'none' : 'currentColor',
|
|
702
|
-
})));
|
|
703
|
-
},
|
|
704
|
-
};
|
|
705
|
-
};
|
|
706
|
-
|
|
707
623
|
/*!
|
|
708
624
|
* Waves Effect for Mithril Materialized
|
|
709
625
|
* Based on Waves v0.6.4 by Alfiana E. Sibuea
|
|
@@ -827,7 +743,7 @@ const ButtonFactory = (element, defaultClassNames, type = '') => {
|
|
|
827
743
|
ontouchend: WavesEffect.onTouchEnd,
|
|
828
744
|
}
|
|
829
745
|
: {};
|
|
830
|
-
return m(element, Object.assign(Object.assign(Object.assign({}, params), wavesHandlers), { className: cn, 'data-position': tooltip ? position : undefined, 'data-tooltip': tooltip || undefined, type: buttonType }), iconName ? m(Icon, { iconName, className: iconClass
|
|
746
|
+
return m(element, Object.assign(Object.assign(Object.assign({}, params), wavesHandlers), { className: cn, 'data-position': tooltip ? position : undefined, 'data-tooltip': tooltip || undefined, type: buttonType }), iconName ? m(Icon, { iconName, className: iconClass !== undefined ? iconClass : 'left' }) : undefined, label ? label : undefined, children);
|
|
831
747
|
},
|
|
832
748
|
};
|
|
833
749
|
};
|
|
@@ -839,7 +755,7 @@ const FlatButton = ButtonFactory('a', 'waves-effect waves-teal btn-flat', 'butto
|
|
|
839
755
|
const IconButton = ButtonFactory('button', 'btn-flat btn-icon waves-effect waves-teal', 'button');
|
|
840
756
|
const RoundIconButton = ButtonFactory('button', 'btn-floating btn-large waves-effect waves-light', 'button');
|
|
841
757
|
const SubmitButton = ButtonFactory('button', 'btn waves-effect waves-light', 'submit');
|
|
842
|
-
const
|
|
758
|
+
const SmallRaisedIconButton = ButtonFactory('button', 'btn-small btn-icon waves-effect waves-light', 'button');
|
|
843
759
|
const ConfirmButton = () => {
|
|
844
760
|
let isConfirming = false;
|
|
845
761
|
let isBlocked = false;
|
|
@@ -859,7 +775,7 @@ const ConfirmButton = () => {
|
|
|
859
775
|
window.clearTimeout(blockTimeoutId);
|
|
860
776
|
},
|
|
861
777
|
view: ({ attrs }) => {
|
|
862
|
-
const { iconName = 'delete', confirmIconName = 'check', confirmColor = 'red', timeout = 3000, clickDelay = 500, onFirstClick, onclick } = attrs, props = __rest(attrs, ["iconName", "confirmIconName", "confirmColor", "timeout", "clickDelay", "onFirstClick", "onclick"]);
|
|
778
|
+
const { iconName = 'delete', confirmIconName = 'check', confirmColor = 'red', timeout = 3000, clickDelay = 500, onFirstClick, onclick, iconClass, label } = attrs, props = __rest(attrs, ["iconName", "confirmIconName", "confirmColor", "timeout", "clickDelay", "onFirstClick", "onclick", "iconClass", "label"]);
|
|
863
779
|
const handleClick = (e) => {
|
|
864
780
|
e.preventDefault();
|
|
865
781
|
if (isBlocked)
|
|
@@ -878,12 +794,21 @@ const ConfirmButton = () => {
|
|
|
878
794
|
blockTimeoutId = window.setTimeout(unblock, clickDelay);
|
|
879
795
|
}
|
|
880
796
|
};
|
|
797
|
+
const currentIconName = isConfirming ? confirmIconName : iconName;
|
|
881
798
|
const cn = isConfirming ? confirmColor : 'red-text';
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
799
|
+
// Choose button component based on label and confirming state
|
|
800
|
+
let ButtonComponent;
|
|
801
|
+
if (label) {
|
|
802
|
+
ButtonComponent = FlatButton;
|
|
803
|
+
}
|
|
804
|
+
else {
|
|
805
|
+
// Icon-only: use small raised button for square shape when confirming
|
|
806
|
+
ButtonComponent = isConfirming ? SmallRaisedIconButton : IconButton;
|
|
885
807
|
}
|
|
886
|
-
|
|
808
|
+
// Add square styling for icon-only confirming state
|
|
809
|
+
const buttonStyle = !label && isConfirming
|
|
810
|
+
? Object.assign(Object.assign({}, props.style), { width: '36px', height: '36px', padding: '0', minWidth: '28px', display: 'inline-flex', alignItems: 'center', justifyContent: 'center', borderRadius: '2px' }) : props.style;
|
|
811
|
+
return m(ButtonComponent, Object.assign(Object.assign({}, props), { style: buttonStyle, className: `${props.className || ''} ${cn}`, iconName: currentIconName, iconClass: label ? (iconClass || 'left') : '', label, onclick: handleClick }));
|
|
887
812
|
},
|
|
888
813
|
};
|
|
889
814
|
};
|
|
@@ -1278,6 +1203,90 @@ const Carousel = () => {
|
|
|
1278
1203
|
};
|
|
1279
1204
|
};
|
|
1280
1205
|
|
|
1206
|
+
const iconPaths = {
|
|
1207
|
+
caret: [
|
|
1208
|
+
'M7 10l5 5 5-5z', // arrow
|
|
1209
|
+
'M0 0h24v24H0z', // background
|
|
1210
|
+
],
|
|
1211
|
+
close: [
|
|
1212
|
+
'M18.3 5.71a1 1 0 0 0-1.41 0L12 10.59 7.11 5.7A1 1 0 0 0 5.7 7.11L10.59 12l-4.89 4.89a1 1 0 1 0 1.41 1.41L12 13.41l4.89 4.89a1 1 0 0 0 1.41-1.41L13.41 12l4.89-4.89a1 1 0 0 0 0-1.4z',
|
|
1213
|
+
'M0 0h24v24H0z',
|
|
1214
|
+
],
|
|
1215
|
+
chevron: [
|
|
1216
|
+
'M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z', // chevron down
|
|
1217
|
+
'M0 0h24v24H0z', // background
|
|
1218
|
+
],
|
|
1219
|
+
chevron_left: [
|
|
1220
|
+
'M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z', // chevron left
|
|
1221
|
+
'M0 0h24v24H0z', // background
|
|
1222
|
+
],
|
|
1223
|
+
chevron_right: [
|
|
1224
|
+
'M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z', // chevron right
|
|
1225
|
+
'M0 0h24v24H0z', // background
|
|
1226
|
+
],
|
|
1227
|
+
menu: [
|
|
1228
|
+
'M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z', // hamburger menu
|
|
1229
|
+
'M0 0h24v24H0z', // background
|
|
1230
|
+
],
|
|
1231
|
+
expand: [
|
|
1232
|
+
'M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z', // plus
|
|
1233
|
+
'M0 0h24v24H0z', // background
|
|
1234
|
+
],
|
|
1235
|
+
collapse: [
|
|
1236
|
+
'M19 13H5v-2h14v2z', // minus
|
|
1237
|
+
'M0 0h24v24H0z', // background
|
|
1238
|
+
],
|
|
1239
|
+
check: [
|
|
1240
|
+
'M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z', // checkmark
|
|
1241
|
+
'M0 0h24v24H0z', // background
|
|
1242
|
+
],
|
|
1243
|
+
radio_checked: [
|
|
1244
|
+
'M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z', // radio button checked
|
|
1245
|
+
'M0 0h24v24H0z', // background
|
|
1246
|
+
],
|
|
1247
|
+
radio_unchecked: [
|
|
1248
|
+
'M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z', // radio button unchecked
|
|
1249
|
+
'M0 0h24v24H0z', // background
|
|
1250
|
+
],
|
|
1251
|
+
light_mode: [
|
|
1252
|
+
'M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5M2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1m18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1M11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1m0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1M5.99 4.58a.996.996 0 0 0-1.41 0 .996.996 0 0 0 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41zm12.4 12.4a.996.996 0 0 0-1.41 0 .996.996 0 0 0 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0a.996.996 0 0 0 0-1.41zm1.06-11a.996.996 0 0 0 0-1.41.996.996 0 0 0-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0zM7.05 18.4a.996.996 0 0 0 0-1.41.996.996 0 0 0-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0z',
|
|
1253
|
+
'M0 0h24v24H0z', // background
|
|
1254
|
+
],
|
|
1255
|
+
dark_mode: [
|
|
1256
|
+
'M12 3a9 9 0 1 0 9 9c0-.46-.04-.92-.1-1.36a5.39 5.39 0 0 1-4.4 2.26 5.4 5.4 0 0 1-3.14-9.8c-.44-.06-.9-.1-1.36-.1z',
|
|
1257
|
+
'M0 0h24v24H0z', // background
|
|
1258
|
+
],
|
|
1259
|
+
delete: [
|
|
1260
|
+
// trashbin
|
|
1261
|
+
'M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z',
|
|
1262
|
+
'M0 0h24v24H0z', // background
|
|
1263
|
+
],
|
|
1264
|
+
};
|
|
1265
|
+
const MaterialIcon = () => {
|
|
1266
|
+
return {
|
|
1267
|
+
view: ({ attrs }) => {
|
|
1268
|
+
var _a;
|
|
1269
|
+
const { name, direction = 'down', style } = attrs, props = __rest(attrs, ["name", "direction", "style"]);
|
|
1270
|
+
const rotationMap = {
|
|
1271
|
+
down: 0,
|
|
1272
|
+
up: 180,
|
|
1273
|
+
left: 90,
|
|
1274
|
+
right: -90,
|
|
1275
|
+
};
|
|
1276
|
+
const rotation = (_a = rotationMap[direction]) !== null && _a !== void 0 ? _a : 0;
|
|
1277
|
+
const transform = rotation ? `rotate(${rotation}deg)` : undefined;
|
|
1278
|
+
const icon = iconPaths[name];
|
|
1279
|
+
if (!icon || !Array.isArray(icon)) {
|
|
1280
|
+
return m(Icon, Object.assign(Object.assign({}, props), { iconName: name }));
|
|
1281
|
+
}
|
|
1282
|
+
return m('svg', Object.assign(Object.assign({}, props), { style: Object.assign({ display: 'inline-block', verticalAlign: 'middle', transform }, style), height: '24px', width: '24px', viewBox: '0 0 24 24', xmlns: 'http://www.w3.org/2000/svg' }), icon === null || icon === void 0 ? void 0 : icon.map((d) => m('path', {
|
|
1283
|
+
d,
|
|
1284
|
+
fill: d.includes('M0 0h24v24H0z') ? 'none' : 'currentColor',
|
|
1285
|
+
})));
|
|
1286
|
+
},
|
|
1287
|
+
};
|
|
1288
|
+
};
|
|
1289
|
+
|
|
1281
1290
|
const Chips = () => {
|
|
1282
1291
|
const state = {
|
|
1283
1292
|
chipsData: [],
|
package/dist/index.umd.js
CHANGED
|
@@ -622,90 +622,6 @@
|
|
|
622
622
|
},
|
|
623
623
|
});
|
|
624
624
|
|
|
625
|
-
const iconPaths = {
|
|
626
|
-
caret: [
|
|
627
|
-
'M7 10l5 5 5-5z', // arrow
|
|
628
|
-
'M0 0h24v24H0z', // background
|
|
629
|
-
],
|
|
630
|
-
close: [
|
|
631
|
-
'M18.3 5.71a1 1 0 0 0-1.41 0L12 10.59 7.11 5.7A1 1 0 0 0 5.7 7.11L10.59 12l-4.89 4.89a1 1 0 1 0 1.41 1.41L12 13.41l4.89 4.89a1 1 0 0 0 1.41-1.41L13.41 12l4.89-4.89a1 1 0 0 0 0-1.4z',
|
|
632
|
-
'M0 0h24v24H0z',
|
|
633
|
-
],
|
|
634
|
-
chevron: [
|
|
635
|
-
'M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z', // chevron down
|
|
636
|
-
'M0 0h24v24H0z', // background
|
|
637
|
-
],
|
|
638
|
-
chevron_left: [
|
|
639
|
-
'M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z', // chevron left
|
|
640
|
-
'M0 0h24v24H0z', // background
|
|
641
|
-
],
|
|
642
|
-
chevron_right: [
|
|
643
|
-
'M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z', // chevron right
|
|
644
|
-
'M0 0h24v24H0z', // background
|
|
645
|
-
],
|
|
646
|
-
menu: [
|
|
647
|
-
'M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z', // hamburger menu
|
|
648
|
-
'M0 0h24v24H0z', // background
|
|
649
|
-
],
|
|
650
|
-
expand: [
|
|
651
|
-
'M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z', // plus
|
|
652
|
-
'M0 0h24v24H0z', // background
|
|
653
|
-
],
|
|
654
|
-
collapse: [
|
|
655
|
-
'M19 13H5v-2h14v2z', // minus
|
|
656
|
-
'M0 0h24v24H0z', // background
|
|
657
|
-
],
|
|
658
|
-
check: [
|
|
659
|
-
'M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z', // checkmark
|
|
660
|
-
'M0 0h24v24H0z', // background
|
|
661
|
-
],
|
|
662
|
-
radio_checked: [
|
|
663
|
-
'M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z', // radio button checked
|
|
664
|
-
'M0 0h24v24H0z', // background
|
|
665
|
-
],
|
|
666
|
-
radio_unchecked: [
|
|
667
|
-
'M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z', // radio button unchecked
|
|
668
|
-
'M0 0h24v24H0z', // background
|
|
669
|
-
],
|
|
670
|
-
light_mode: [
|
|
671
|
-
'M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5M2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1m18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1M11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1m0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1M5.99 4.58a.996.996 0 0 0-1.41 0 .996.996 0 0 0 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41zm12.4 12.4a.996.996 0 0 0-1.41 0 .996.996 0 0 0 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0a.996.996 0 0 0 0-1.41zm1.06-11a.996.996 0 0 0 0-1.41.996.996 0 0 0-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0zM7.05 18.4a.996.996 0 0 0 0-1.41.996.996 0 0 0-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0z',
|
|
672
|
-
'M0 0h24v24H0z', // background
|
|
673
|
-
],
|
|
674
|
-
dark_mode: [
|
|
675
|
-
'M12 3a9 9 0 1 0 9 9c0-.46-.04-.92-.1-1.36a5.39 5.39 0 0 1-4.4 2.26 5.4 5.4 0 0 1-3.14-9.8c-.44-.06-.9-.1-1.36-.1z',
|
|
676
|
-
'M0 0h24v24H0z', // background
|
|
677
|
-
],
|
|
678
|
-
delete: [
|
|
679
|
-
// trashbin
|
|
680
|
-
'M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z',
|
|
681
|
-
'M0 0h24v24H0z', // background
|
|
682
|
-
],
|
|
683
|
-
};
|
|
684
|
-
const MaterialIcon = () => {
|
|
685
|
-
return {
|
|
686
|
-
view: ({ attrs }) => {
|
|
687
|
-
var _a;
|
|
688
|
-
const { name, direction = 'down', style } = attrs, props = __rest(attrs, ["name", "direction", "style"]);
|
|
689
|
-
const rotationMap = {
|
|
690
|
-
down: 0,
|
|
691
|
-
up: 180,
|
|
692
|
-
left: 90,
|
|
693
|
-
right: -90,
|
|
694
|
-
};
|
|
695
|
-
const rotation = (_a = rotationMap[direction]) !== null && _a !== void 0 ? _a : 0;
|
|
696
|
-
const transform = rotation ? `rotate(${rotation}deg)` : undefined;
|
|
697
|
-
const icon = iconPaths[name];
|
|
698
|
-
if (!icon || !Array.isArray(icon)) {
|
|
699
|
-
return m(Icon, Object.assign(Object.assign({}, props), { iconName: name }));
|
|
700
|
-
}
|
|
701
|
-
return m('svg', Object.assign(Object.assign({}, props), { style: Object.assign({ transform }, style), height: '24px', width: '24px', viewBox: '0 0 24 24', xmlns: 'http://www.w3.org/2000/svg' }), icon === null || icon === void 0 ? void 0 : icon.map((d) => m('path', {
|
|
702
|
-
d,
|
|
703
|
-
fill: d.includes('M0 0h24v24H0z') ? 'none' : 'currentColor',
|
|
704
|
-
})));
|
|
705
|
-
},
|
|
706
|
-
};
|
|
707
|
-
};
|
|
708
|
-
|
|
709
625
|
/*!
|
|
710
626
|
* Waves Effect for Mithril Materialized
|
|
711
627
|
* Based on Waves v0.6.4 by Alfiana E. Sibuea
|
|
@@ -829,7 +745,7 @@
|
|
|
829
745
|
ontouchend: WavesEffect.onTouchEnd,
|
|
830
746
|
}
|
|
831
747
|
: {};
|
|
832
|
-
return m(element, Object.assign(Object.assign(Object.assign({}, params), wavesHandlers), { className: cn, 'data-position': tooltip ? position : undefined, 'data-tooltip': tooltip || undefined, type: buttonType }), iconName ? m(Icon, { iconName, className: iconClass
|
|
748
|
+
return m(element, Object.assign(Object.assign(Object.assign({}, params), wavesHandlers), { className: cn, 'data-position': tooltip ? position : undefined, 'data-tooltip': tooltip || undefined, type: buttonType }), iconName ? m(Icon, { iconName, className: iconClass !== undefined ? iconClass : 'left' }) : undefined, label ? label : undefined, children);
|
|
833
749
|
},
|
|
834
750
|
};
|
|
835
751
|
};
|
|
@@ -841,7 +757,7 @@
|
|
|
841
757
|
const IconButton = ButtonFactory('button', 'btn-flat btn-icon waves-effect waves-teal', 'button');
|
|
842
758
|
const RoundIconButton = ButtonFactory('button', 'btn-floating btn-large waves-effect waves-light', 'button');
|
|
843
759
|
const SubmitButton = ButtonFactory('button', 'btn waves-effect waves-light', 'submit');
|
|
844
|
-
const
|
|
760
|
+
const SmallRaisedIconButton = ButtonFactory('button', 'btn-small btn-icon waves-effect waves-light', 'button');
|
|
845
761
|
const ConfirmButton = () => {
|
|
846
762
|
let isConfirming = false;
|
|
847
763
|
let isBlocked = false;
|
|
@@ -861,7 +777,7 @@
|
|
|
861
777
|
window.clearTimeout(blockTimeoutId);
|
|
862
778
|
},
|
|
863
779
|
view: ({ attrs }) => {
|
|
864
|
-
const { iconName = 'delete', confirmIconName = 'check', confirmColor = 'red', timeout = 3000, clickDelay = 500, onFirstClick, onclick } = attrs, props = __rest(attrs, ["iconName", "confirmIconName", "confirmColor", "timeout", "clickDelay", "onFirstClick", "onclick"]);
|
|
780
|
+
const { iconName = 'delete', confirmIconName = 'check', confirmColor = 'red', timeout = 3000, clickDelay = 500, onFirstClick, onclick, iconClass, label } = attrs, props = __rest(attrs, ["iconName", "confirmIconName", "confirmColor", "timeout", "clickDelay", "onFirstClick", "onclick", "iconClass", "label"]);
|
|
865
781
|
const handleClick = (e) => {
|
|
866
782
|
e.preventDefault();
|
|
867
783
|
if (isBlocked)
|
|
@@ -880,12 +796,21 @@
|
|
|
880
796
|
blockTimeoutId = window.setTimeout(unblock, clickDelay);
|
|
881
797
|
}
|
|
882
798
|
};
|
|
799
|
+
const currentIconName = isConfirming ? confirmIconName : iconName;
|
|
883
800
|
const cn = isConfirming ? confirmColor : 'red-text';
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
801
|
+
// Choose button component based on label and confirming state
|
|
802
|
+
let ButtonComponent;
|
|
803
|
+
if (label) {
|
|
804
|
+
ButtonComponent = FlatButton;
|
|
805
|
+
}
|
|
806
|
+
else {
|
|
807
|
+
// Icon-only: use small raised button for square shape when confirming
|
|
808
|
+
ButtonComponent = isConfirming ? SmallRaisedIconButton : IconButton;
|
|
887
809
|
}
|
|
888
|
-
|
|
810
|
+
// Add square styling for icon-only confirming state
|
|
811
|
+
const buttonStyle = !label && isConfirming
|
|
812
|
+
? Object.assign(Object.assign({}, props.style), { width: '36px', height: '36px', padding: '0', minWidth: '28px', display: 'inline-flex', alignItems: 'center', justifyContent: 'center', borderRadius: '2px' }) : props.style;
|
|
813
|
+
return m(ButtonComponent, Object.assign(Object.assign({}, props), { style: buttonStyle, className: `${props.className || ''} ${cn}`, iconName: currentIconName, iconClass: label ? (iconClass || 'left') : '', label, onclick: handleClick }));
|
|
889
814
|
},
|
|
890
815
|
};
|
|
891
816
|
};
|
|
@@ -1280,6 +1205,90 @@
|
|
|
1280
1205
|
};
|
|
1281
1206
|
};
|
|
1282
1207
|
|
|
1208
|
+
const iconPaths = {
|
|
1209
|
+
caret: [
|
|
1210
|
+
'M7 10l5 5 5-5z', // arrow
|
|
1211
|
+
'M0 0h24v24H0z', // background
|
|
1212
|
+
],
|
|
1213
|
+
close: [
|
|
1214
|
+
'M18.3 5.71a1 1 0 0 0-1.41 0L12 10.59 7.11 5.7A1 1 0 0 0 5.7 7.11L10.59 12l-4.89 4.89a1 1 0 1 0 1.41 1.41L12 13.41l4.89 4.89a1 1 0 0 0 1.41-1.41L13.41 12l4.89-4.89a1 1 0 0 0 0-1.4z',
|
|
1215
|
+
'M0 0h24v24H0z',
|
|
1216
|
+
],
|
|
1217
|
+
chevron: [
|
|
1218
|
+
'M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z', // chevron down
|
|
1219
|
+
'M0 0h24v24H0z', // background
|
|
1220
|
+
],
|
|
1221
|
+
chevron_left: [
|
|
1222
|
+
'M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z', // chevron left
|
|
1223
|
+
'M0 0h24v24H0z', // background
|
|
1224
|
+
],
|
|
1225
|
+
chevron_right: [
|
|
1226
|
+
'M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z', // chevron right
|
|
1227
|
+
'M0 0h24v24H0z', // background
|
|
1228
|
+
],
|
|
1229
|
+
menu: [
|
|
1230
|
+
'M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z', // hamburger menu
|
|
1231
|
+
'M0 0h24v24H0z', // background
|
|
1232
|
+
],
|
|
1233
|
+
expand: [
|
|
1234
|
+
'M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z', // plus
|
|
1235
|
+
'M0 0h24v24H0z', // background
|
|
1236
|
+
],
|
|
1237
|
+
collapse: [
|
|
1238
|
+
'M19 13H5v-2h14v2z', // minus
|
|
1239
|
+
'M0 0h24v24H0z', // background
|
|
1240
|
+
],
|
|
1241
|
+
check: [
|
|
1242
|
+
'M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z', // checkmark
|
|
1243
|
+
'M0 0h24v24H0z', // background
|
|
1244
|
+
],
|
|
1245
|
+
radio_checked: [
|
|
1246
|
+
'M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z', // radio button checked
|
|
1247
|
+
'M0 0h24v24H0z', // background
|
|
1248
|
+
],
|
|
1249
|
+
radio_unchecked: [
|
|
1250
|
+
'M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z', // radio button unchecked
|
|
1251
|
+
'M0 0h24v24H0z', // background
|
|
1252
|
+
],
|
|
1253
|
+
light_mode: [
|
|
1254
|
+
'M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5M2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1m18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1M11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1m0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1M5.99 4.58a.996.996 0 0 0-1.41 0 .996.996 0 0 0 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41zm12.4 12.4a.996.996 0 0 0-1.41 0 .996.996 0 0 0 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0a.996.996 0 0 0 0-1.41zm1.06-11a.996.996 0 0 0 0-1.41.996.996 0 0 0-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0zM7.05 18.4a.996.996 0 0 0 0-1.41.996.996 0 0 0-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0z',
|
|
1255
|
+
'M0 0h24v24H0z', // background
|
|
1256
|
+
],
|
|
1257
|
+
dark_mode: [
|
|
1258
|
+
'M12 3a9 9 0 1 0 9 9c0-.46-.04-.92-.1-1.36a5.39 5.39 0 0 1-4.4 2.26 5.4 5.4 0 0 1-3.14-9.8c-.44-.06-.9-.1-1.36-.1z',
|
|
1259
|
+
'M0 0h24v24H0z', // background
|
|
1260
|
+
],
|
|
1261
|
+
delete: [
|
|
1262
|
+
// trashbin
|
|
1263
|
+
'M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z',
|
|
1264
|
+
'M0 0h24v24H0z', // background
|
|
1265
|
+
],
|
|
1266
|
+
};
|
|
1267
|
+
const MaterialIcon = () => {
|
|
1268
|
+
return {
|
|
1269
|
+
view: ({ attrs }) => {
|
|
1270
|
+
var _a;
|
|
1271
|
+
const { name, direction = 'down', style } = attrs, props = __rest(attrs, ["name", "direction", "style"]);
|
|
1272
|
+
const rotationMap = {
|
|
1273
|
+
down: 0,
|
|
1274
|
+
up: 180,
|
|
1275
|
+
left: 90,
|
|
1276
|
+
right: -90,
|
|
1277
|
+
};
|
|
1278
|
+
const rotation = (_a = rotationMap[direction]) !== null && _a !== void 0 ? _a : 0;
|
|
1279
|
+
const transform = rotation ? `rotate(${rotation}deg)` : undefined;
|
|
1280
|
+
const icon = iconPaths[name];
|
|
1281
|
+
if (!icon || !Array.isArray(icon)) {
|
|
1282
|
+
return m(Icon, Object.assign(Object.assign({}, props), { iconName: name }));
|
|
1283
|
+
}
|
|
1284
|
+
return m('svg', Object.assign(Object.assign({}, props), { style: Object.assign({ display: 'inline-block', verticalAlign: 'middle', transform }, style), height: '24px', width: '24px', viewBox: '0 0 24 24', xmlns: 'http://www.w3.org/2000/svg' }), icon === null || icon === void 0 ? void 0 : icon.map((d) => m('path', {
|
|
1285
|
+
d,
|
|
1286
|
+
fill: d.includes('M0 0h24v24H0z') ? 'none' : 'currentColor',
|
|
1287
|
+
})));
|
|
1288
|
+
},
|
|
1289
|
+
};
|
|
1290
|
+
};
|
|
1291
|
+
|
|
1283
1292
|
const Chips = () => {
|
|
1284
1293
|
const state = {
|
|
1285
1294
|
chipsData: [],
|